Re: Reading strings using BufferedReader.readLine() is too slow



Gordon Beaton wrote:

Your subject line is wrong, it isn't BufferedReader.readline() which
is slow. The real problem is, as you correctly point out in the text,
string concatenation.

Also, if you don't want to create a String per line, blocks can be read into a char array with Reader.read(char[]) (note: read does not necessarily fill the entire array, even if not at the end of file). You can then drop the BufferedReader, as all that will be doing is an additional copy of the data.

Tom Hawtin
.