code: public int append(byte[] b, int offset, int length) {
          int oldLength = bytesLength;
          bytesLength += length;
          int newCapacity = capacityPolicy.ensureCapacity(bytesLength, bytes.length);
          if (newCapacity > bytes.length) {
              byte[] newB = new byte[newCapacity];
              System.arraycopy(bytes, 0, newB, 0, bytes.length); // copy current bytes to new bytes
              bytes = newB;
          }
          System.arraycopy(b, offset, bytes, oldLength, length); // assign value
          normalizeCommandLength();
          return bytesLength;
      }
docs: Append bytes to specified offset and length.
  
  @param b is the bytes to append.
  @param offset is the offset where the bytes will be placed.
  @param length the length that will specified which part of the bytes will
  be append.
  @return the latest length of the byte buffer.