@Override
      public int findCommonPrefix(byte[] left, int leftOffset, int leftLength, byte[] right,
        int rightOffset, int rightLength) {
        int length = Math.min(leftLength, rightLength);
        int result = 0;

        while (result < length && left[leftOffset + result] == right[rightOffset + result]) {
          result++;
        }
        return result;
      }
Lexicographically compare two arrays.
@param buffer1 left operand
@param buffer2 right operand
@param offset1 Where to start comparing in the left buffer
@param offset2 Where to start comparing in the right buffer
@param length1 How much to compare from the left buffer
@param length2 How much to compare from the right buffer
@return 0 if equal, < 0 if left is less than right, etc.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java