Vikki Fiawoo wrote:
If you look at the Javadocs for
java.io.Reader#read(char[]), it describes the return value as "The number of characters read, or -1 if the end of the stream has been reached". So this line keeps looping, reading characters into the
cbuf array, until the end of the file.
The Javadocs should generally be your first port of call for understanding what methods do for classes in the core libraries.