Hi! I have to read an ASCII file, represented by a FileInputStream, through an InputStreamReader. I use the read() method explained below :
int read(char cbuf, int off, int len)
Read characters into a portion of an array.
I encounter an annoying problem, I don't know how to detect the end of file, as this method doesn't throw an EOFException. Also, the only way to detect the end of line was to read the stream char by char, waiting to find the '\n' indicator.
So, any idea to read an ASCII file line by line and detect the end of file, without knowing how many lines there are?
Thanx a lot!