private static int memCmp(byte[] s1, int s1offset, byte[] s2, int s2offset) {
    int n = s1.length - s1offset;
    if (n > (s2.length - s2offset)) {
      n = s2.length - s2offset;
    }
    for (int i = 0; i < n; i++) {
      if (s1[i + s1offset] != s2[i + s2offset]) {
        return s1[i + s1offset] < s2[i + s2offset] ? -1 : 1;
      }
    }
    return 0;
  }
private static int memCmp(byte[] s1, int s1offset, byte[] s2, int s2offset)