code: private static int compare(byte[] s1, int start1, int lens1, byte[] s2, int start2, int lens2) {
      final int max = Math.min(lens1, lens2);
  
      for (int i = 0; i < max; i++) {
        final byte c1 = s1[start1++];
        final byte c2 = s2[start2++];
        if (c1 != c2)
          return (c1 & 0xff) - (c2 & 0xff);
      }
  
      return lens1 - lens2;
    }
docs: Lexicographic order of input sequences. By default, consistent with the "C"
  sort (absolute value of bytes, 0-255).