I keep getting an EOFException when parsing the db file. Does anyone know how to stop the exception from occuring? The file is always successfully parsed to my liking, except an error occurs at the end. Here it is pasted in.
here is some of my code where i suspect the problem is, maybe someone can tell me what I am doing wrong, thanks
[ October 27, 2004: Message edited by: Sean Gildea ] [ October 27, 2004: Message edited by: Sean Gildea ]
Sean, In your for loops there is no guarantee that the file will be read even after the EOf is reached. To exit from both for loops give a "break" after bytesRead += raf.read(bytes); //in the inner for loop so that you exit both loops with single break. One way to to do this is by using label.
Pleae consider redesigning this part. The array length is hardcoded. It should be coming from the file metadata which may be provided. The outer for loop is not needed. All it does is checking for EOF. Many developers don't like using break. Please check code conventions to see whether any reference to break is there.
[Andrew: broke up increadibly long lines of code] [ October 27, 2004: Message edited by: Andrew Monkhouse ]