code: public synchronized void writeTo(final OutputStream out) throws IOException {
      for (BufferPool.Buffer b: buffers) {
        out.write(b.buf, 0, b.pos);
      }
    }
docs: Writes the complete contents of this byte array output stream to
  the specified output stream argument, as if by calling the output
  stream's write method using <code>out.write(buf, 0, count)</code>.
  
  @param      out   the output stream to which to write the data.
  @exception  IOException  if an I/O error occurs.