public synchronized int read() throws IOException {     if (po == null) if (buffer == null) throw new IOException("pipe closed"); else throw new IOException("pipe unconnected");
read() throws IOException {       int bytes_read = read(read_buf, 0, read_buf.length);
  public synchronized int read() throws IOException  {    // TBD: Spec says to throw IOException if thread writing to output stream    // died.  What does this really mean?  Theoretically, multiple threads    // could be writing to this object.  Do you track the first, last, or    // all of them?    if (po == null)      if (buffer == null)        throw new IOException("pipe closed");      else        throw new IOException("pipe unconnected");    // Block until there's something to read or output stream was closed.    while (in < 0)      try	{	  if (outClosed)	    return -1;	  wait();	}      catch (InterruptedException ex)       {	 throw new InterruptedIOException();       }    // Let other threads know there's room to write now.    notifyAll();    int retval = buffer[out++] & 0xFF;    // Wrap back around if at end of the array.    if (out >= buffer.length)      out = 0;    // When the last byte available is read, mark the buffer as empty.    if (out == in)      {        in = -1;	out = 0;      }          return retval;  }