Class CelByteString


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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      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.
      boolean isEmpty()  
      static CelByteString of​(byte[] buffer)  
      int size()  
      byte[] toByteArray()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • 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