BufferedReader.read

BufferedReader.read

Class Overview | Class Members | This Package | All Packages

Syntax 1
public int read() throws IOException
Description
Read a single character.

Exceptions
IOException If an I/O error occurs
Overrides
read in class Reader



Syntax 2
public int read( char cbuf[], int off, int len ) throws IOException
Parameters
cbuf
Destination buffer
off
Offset at which to start storing characters
len
Maximum number of characters to read
Returns
The number of bytes read, or -1 if the end of the stream has been reached
Description
Read characters into a portion of an array.

Ordinarily this method takes characters from this stream's character buffer, filling it from the underlying stream as necessary. If, however, the buffer is empty, the mark is not valid, and the requested length is at least as large as the buffer, then this method will read characters directly from the underlying stream into the given array. Thus redundant BufferedReaders will not copy data unnecessarily.

Exceptions
IOException If an I/O error occurs
Overrides
read in class Reader