Reader.read

Reader.read

Class Overview | Class Members | This Package | All Packages

Syntax 1
public int read() throws IOException
Returns
The character read, as an integer in the range 0 to 16383 (0x00-0xffff), or -1 if the end of the stream has been reached
Description
Read a single character. This method will block until a character is available, an I/O error occurs, or the end of the stream is reached.

Subclasses that intend to support efficient single-character input should override this method.

Exceptions
IOException If an I/O error occurs



Syntax 2
public int read( char cbuf[] ) throws IOException
Parameters
cbuf
Destination buffer
Returns
The number of bytes read, or -1 if the end of the stream has been reached
Description
Read characters into an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached.

Exceptions
IOException If an I/O error occurs



Syntax 3
public abstract 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 characters read, or -1 if the end of the stream has been reached
Description
Read characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached.

Exceptions
IOException If an I/O error occurs