Reader

A classe Reader equivale à classe InputStream, com a diferença que ela é voltada para a manipulação de caracteres ao invés da manipulação de bytes. Ela oferece, entre outros, os métodos:
read
 public int read() throws IOException
	  
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.
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
Throws: IOException
If an I/O error occurs
read
 public int read(char cbuf[]) throws IOException
	  
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.

Parameters:
cbuf - Destination buffer
Returns:
The number of bytes read, or -1 if the end of the stream has been reached
Throws: IOException
If an I/O error occurs
ready
 public boolean ready() throws IOException
	  
Tell whether this stream is ready to be read.

Returns:
True if the next read() is guaranteed not to block for input, false otherwise. Note that returning false does not guarantee that the next read will block.
Throws: IOException
If an I/O error occurs


© Ivan Luiz Marques Ricarte
DCA/FEEC/UNICAMP

Last modified: Mon Nov 8 12:06:47 EDT 1999