code: public void writeTo(OutputStream out) throws IOException {
          out.write(data.bytes, 0, data.size);
      }
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.
  @throws IOException if an I/O error occurs.