Package java.io
Class PipedReader

Public Method ready

boolean ready()

Overrides:

Throws:

_INSERT_METHOD_SIGNATURE_HERE_

Description:

This method tell whether this stream is ready to be read. A piped character stream is ready if the circular buffer is not empty.

Example

   PipedReader pr = new PipedReader();
   PipedWriter pw = new PipedWriter(pr);

   byte[] b = {10,20};
   pw.write(b, 0, 2);
   if (pr.ready())
      Console.println("data: " + pr.read());
   else
      Console.println("stream is not ready");

The example reads the data from the piped stream and prints it to the console if the stream is ready.