Class CelByteString


  • @Immutable
    public final class CelByteString
    extends java.lang.Object
    CelByteString is an immutable sequence of a byte array.
    • Method Detail

      • copyFromUtf8

        public static CelByteString copyFromUtf8​(java.lang.String utf8String)
      • unsignedLexicographicalComparator

        public static java.util.Comparator<CelByteString> unsignedLexicographicalComparator()
      • toStringUtf8

        public java.lang.String toStringUtf8()
      • isValidUtf8

        public boolean isValidUtf8()
        Checks if the byte array is a valid utf-8 encoded text.
      • size

        public int size()
      • isEmpty

        public boolean isEmpty()
      • toByteArray

        public byte[] toByteArray()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Note that we do not use Arrays.hashCode directly due to its implementation using 31 as an odd prime, which is outdated and is more prone to hash collisions. This code is very similar to what AutoValue generates.
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object