Interface ByteComparable

    • Method Detail

      • asComparableBytes

        ByteSource asComparableBytes​(ByteComparable.Version version)
        Returns a source that generates the byte-comparable representation of the value byte by byte.
      • byteComparableAsString

        default java.lang.String byteComparableAsString​(ByteComparable.Version version)
        Construct a human-readable string from the byte-comparable representation. Used for debugging.
      • fixedLength

        static ByteComparable fixedLength​(java.nio.ByteBuffer bytes)
      • fixedLength

        static ByteComparable fixedLength​(byte[] bytes,
                                          int offset,
                                          int len)
      • separatorPrefix

        static ByteComparable separatorPrefix​(ByteComparable prevMax,
                                              ByteComparable currMin)
        Returns a separator for two byte sources, i.e. something that is definitely > prevMax, and <= currMin, assuming prevMax < currMin. This returns the shortest prefix of currMin that is greater than prevMax.
      • separatorGt

        static ByteComparable separatorGt​(ByteComparable prevMax,
                                          ByteComparable currMin)
        Returns a separator for two byte comparable, i.e. something that is definitely > prevMax, and <= currMin, assuming prevMax < currMin. This is a stream of length 1 longer than the common prefix of the two streams, with last byte one higher than the prevMax stream.
      • compare

        static int compare​(ByteComparable bytes1,
                           ByteComparable bytes2,
                           ByteComparable.Version version)
        Compare two byte-comparable values by their byte-comparable representation. Used for tests.
        Returns:
        the result of the lexicographic unsigned byte comparison of the byte-comparable representations of the two arguments