code: @Override
    public void write(byte[] b, int off, int len) throws IOException
    {
      while(len > 0) {
        int c = Math.min(len, bytesBuffer.remaining());
        bytesBuffer.put(b, off, c);
        processBytesBuffer(false);
        len -= c;
        off += c;
      }
    }
docs: Write bytes from the specified byte array to the stream.
  
  @param b the byte array containing the bytes to write,
  @param off the start offset in the byte array,
  @param len the number of bytes to write.
  @throws IOException if writing operation to underlying target writer fails.