RandomAccessFile.readLine () can be a little faster because it ignores character encoding. However, it does not use buffering and still uses StringBuffer: P, so it may be slower on your system.
BufferedReader.readLine () is preferred as it handles character encoding, for example. UTF-8 or Windows-1252.
There is also DataInputStream.readLine (), which can be used with BufferedInputStream. Use only this, you can be sure that you want encoding of ISO-8859-1 or ASCII.
Peter Lawrey
source share