code: public void write(io.netty.buffer.ByteBuf buf, int off, int len) throws IOException {
      if (len == 0) {
        return;
      }
  
      while (len > 0) {
        updateCurrentChunk(false);
        int toWrite = Math.min(len, mCurrentChunk.writableBytes());
        mCurrentChunk.writeBytes(buf, off, toWrite);
        off += toWrite;
        len -= toWrite;
      }
      updateCurrentChunk(false);
    }
docs: Writes len bytes from the specified byte buf starting at offset off to this output stream.
  
  @param buf the buffer
  @param off the offset
  @param len the length