private static int findCommonPrefixInQualifierPart(Cell left, KeyValue.KeyOnlyKeyValue right,
      int qualifierCommonPrefix) {
      if (left instanceof ByteBufferExtendedCell) {
        ByteBufferExtendedCell bbLeft = (ByteBufferExtendedCell) left;
        return ByteBufferUtils.findCommonPrefix(bbLeft.getQualifierByteBuffer(),
          bbLeft.getQualifierPosition() + qualifierCommonPrefix,
          left.getQualifierLength() - qualifierCommonPrefix, right.getQualifierArray(),
          right.getQualifierOffset() + qualifierCommonPrefix,
          right.getQualifierLength() - qualifierCommonPrefix);
      } else {
        return Bytes.findCommonPrefix(left.getQualifierArray(), right.getQualifierArray(),
          left.getQualifierLength() - qualifierCommonPrefix,
          right.getQualifierLength() - qualifierCommonPrefix,
          left.getQualifierOffset() + qualifierCommonPrefix,
          right.getQualifierOffset() + qualifierCommonPrefix);
      }
    }
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