public synchronized boolean ready() throws IOException {
  if (!connected) {
    throw new IOException("Pipe not connected");
  }
 else   if (closedByReader) {
    throw new IOException("Pipe closed");
  }
 else   if (writeSide != null && !writeSide.isAlive() && !closedByWriter && (in < 0)) {
    throw new IOException("Write end dead");
  }
  if (in < 0) {
    return false;
  }
 else {
    return true;
  }
}

public synchronized boolean ready ( ) throws IOException { if ( ! connected ) { throw new IOException ( "Pipe not connected" ) ; } else if ( closedByReader ) { throw new IOException ( "Pipe closed" ) ; } else if ( writeSide != null && ! writeSide . isAlive ( ) && ! closedByWriter && ( in < 0 ) ) { throw new IOException ( "Write end dead" ) ; } if ( in < 0 ) { return false ; } else { return true ; } }
tell whether this stream is ready to be read . a piped character stream is ready if the circular buffer is not empty .
