public static int compareTo(ByteBuffer buf1, int o1, int l1, byte[] buf2, int o2, int l2) {
    return compareTo(buf2, o2, l2, buf1, o1, l1) * -1;
  }
ByteBuffer to hash offset to start from length to hash
hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferUtils.java