private static int findCommonPrefixInRowPart(Cell left, KeyValue.KeyOnlyKeyValue right,
      int rowCommonPrefix) {
      if (left instanceof ByteBufferExtendedCell) {
        ByteBufferExtendedCell bbLeft = (ByteBufferExtendedCell) left;
        return ByteBufferUtils.findCommonPrefix(bbLeft.getRowByteBuffer(),
          bbLeft.getRowPosition() + rowCommonPrefix, left.getRowLength() - rowCommonPrefix,
          right.getRowArray(), right.getRowOffset() + rowCommonPrefix,
          right.getRowLength() - rowCommonPrefix);
      } else {
        return Bytes.findCommonPrefix(left.getRowArray(), right.getRowArray(),
          left.getRowLength() - rowCommonPrefix, right.getRowLength() - rowCommonPrefix,
          left.getRowOffset() + rowCommonPrefix, right.getRowOffset() + rowCommonPrefix);
      }
    }
Copies only the key part of the keybuffer by doing a deep copy and passes the seeker state
members for taking a clone. Note that the value byte[] part is still pointing to the
currentBuffer and represented by the valueOffset and valueLength
hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/BufferedDataBlockEncoder.java