Package java.io
Class InputStreamReader

Public Method ready

boolean ready()

Overrides:

Throws:

_INSERT_METHOD_SIGNATURE_HERE_

Description:

This method tell whether this stream is ready to be read. An InputStreamReader is ready if its input buffer is not empty, or if bytes are available to be read from the underlying byte stream.

Example

   File file = new File("testFile");
   InputStream in = new FileInputStream(file);
   InputStreamReader inr = new InputStreamReader(in);

   char[] charBuff = new char[5];
   if (inr.ready())
      inr.read(charBuff,0,5);

The example above reads five bytes into a character array if the stream is ready.