code: public static long getPrefix(byte[] bytes) {
      if (bytes == null) {
        return 0L;
      } else {
        final int minLen = Math.min(bytes.length, 8);
        long p = 0;
        for (int i = 0; i < minLen; ++i) {
          p |= ((long) Platform.getByte(bytes, Platform.BYTE_ARRAY_OFFSET + i) & 0xff)
              << (56 - 8 * i);
        }
        return p;
      }
    }
docs: Returns a 64-bit integer that can be used as the prefix used in sorting.