Class ByteString


  • public class ByteString
    extends java.lang.Object
    A simple class which encapsulates a byte[] representation of a String using a predefined encoding (currently UTF-8). This avoids repeated invocation of the expensive DataOutput.writeUTF(String) on marshalling
    Since:
    9.0
    Author:
    Tristan Tarrant
    • Method Detail

      • fromString

        public static ByteString fromString​(java.lang.String s)
      • emptyString

        public static ByteString emptyString()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

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

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

        public static void writeObject​(java.io.ObjectOutput output,
                                       ByteString object)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • readObject

        public static ByteString readObject​(java.io.ObjectInput input)
                                     throws java.io.IOException
        Throws:
        java.io.IOException