Java BufferedReader
Java BufferedReader is a public Java class that reads text, using buffering to enable large reads at a time for efficiency, storing what is not needed immediately in memory for later use.
Buffered readers are preferable for more demanding tasks, such as file and streamed readers. Buffering the reads allows large volumes to be read from disk and copied to much faster RAM to increase performance over the multiple network communications or disk reads done with each read command otherwise. Java BufferedReader is preferable anywhere costly reads are likely to be an issue, such as FileReaders and InputStreamReaders, for example:
BufferedReader in
= new BufferedReader(new FileReader("foo.in"));
buffers the input from the file so that each read() or readLine() invocation does not individually cause reads from the file, reducing potential efficiency.
Java BufferedReader has existed since Java Development Kit 1.1.