posted 22 years ago
Hello,
I'm trying to read a fairly large file into my program. The problem is that it is not reading all of the file. It stops after about 22k. Can anyone out there give me a solution to this? I am using the code:
try{
FileInputStream fileIn = new FileInputStream(f);
InputStreamReader inReader = new InputStreamReader(fileIn);
int length = (int)f.length();
BufferedReader in = new BufferedReader(inReader, length);
char file[] = new char[(char)f.length()];
System.out.println(f.length());
in.read(file);
fileIn.close();
Any help would be much appreciated - This is driving me nuts! :-)