code: @Override
      public synchronized int available() throws IOException {
          if (buffer == null || in == -1) {
              return 0;
          }
          return in <= out ? buffer.length - out + in : in - out;
      }
docs: {@inheritDoc}
  
  <p>Unlike most streams, {@code PipedInputStream} returns 0 rather than throwing
  {@code IOException} if the stream has been closed. Unconnected and broken pipes also
  return 0.
  
  @throws IOException if an I/O error occurs