code: public void write(io.netty.buffer.ByteBuf buf) throws IOException {
      write(buf, 0, buf.readableBytes());
    }
docs: Writes the data in the specified byte buf to this output stream.
  
  @param buf the buffer
  @throws IOException