Answer the question
In order to leave comments, you need to log in
Organizing Search in a Java String
Example file to open: 123abcd55ui
I'm reading data from a file into the ch array.
char ch[] = new char[(int) file.length()];
int i =0;
if (!(file.isFile() && file.canRead())) {
System.out.println(file.getName() + " cannot be read from.");
return;
}
try {
FileInputStream fis = new FileInputStream(file);
char current;
while (fis.available() > 0) {
current = (char) fis.read();
ch[i] = current; i++;
//System.out.print(current);
}
} catch (IOException e) {
e.printStackTrace();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question