public boolean ready () throws IOException

Tells 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.

Exceptions:
IOException    If an I/O error occurs