H
Hugo
Hello,
I want to read a file line by line. I first used the readLine() method
which returns a string, but if the line contains too much characters
I'm ending with an OutOfMemory exception. I could use the
read(buffer[], maxChars) method, but this method does not take in
account the end of the line. So my buffer could contain more than a
single line. I would like to use benefit of both methods, meaning
using a method which return a string representing a file's line (like
readLine()), but with a maximum characters per line (like
read(buffer[], maxChars)).
I tried to read the file character by character searching for "\r\n"
and with a maximum number of method calls but it takes too much time
to read the file.
Could someone have an idea how to proceed ?
Thanks a lot.
Hugo
I want to read a file line by line. I first used the readLine() method
which returns a string, but if the line contains too much characters
I'm ending with an OutOfMemory exception. I could use the
read(buffer[], maxChars) method, but this method does not take in
account the end of the line. So my buffer could contain more than a
single line. I would like to use benefit of both methods, meaning
using a method which return a string representing a file's line (like
readLine()), but with a maximum characters per line (like
read(buffer[], maxChars)).
I tried to read the file character by character searching for "\r\n"
and with a maximum number of method calls but it takes too much time
to read the file.
Could someone have an idea how to proceed ?
Thanks a lot.
Hugo