Package io.protostuff

Class StringSerializer.STRING

  • Enclosing class:
    StringSerializer

    public static final class StringSerializer.STRING
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static boolean CESU8_COMPAT  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private STRING()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String deser​(byte[] nonNullValue)  
      static java.lang.String deser​(byte[] nonNullValue, int offset, int len)  
      (package private) static java.lang.String deserCustomOnly​(byte[] nonNullValue)
      Deserialize using readUTF only.
      private static java.lang.String readUTF​(byte[] buffer, int offset, int len)
      Reads the string from a byte[] using that was encoded a using Modified UTF-8 format.
      static byte[] ser​(java.lang.String nonNullValue)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • CESU8_COMPAT

        static final boolean CESU8_COMPAT
    • Constructor Detail

      • STRING

        private STRING()
    • Method Detail

      • deser

        public static java.lang.String deser​(byte[] nonNullValue)
      • deser

        public static java.lang.String deser​(byte[] nonNullValue,
                                             int offset,
                                             int len)
      • deserCustomOnly

        static java.lang.String deserCustomOnly​(byte[] nonNullValue)
        Deserialize using readUTF only.
        Parameters:
        nonNullValue -
        Returns:
      • ser

        public static byte[] ser​(java.lang.String nonNullValue)
      • readUTF

        private static java.lang.String readUTF​(byte[] buffer,
                                                int offset,
                                                int len)
                                         throws java.io.UTFDataFormatException
        Reads the string from a byte[] using that was encoded a using Modified UTF-8 format. Additionally supports 4-byte surrogates, de-serializing them as surrogate pairs. See: http://en.wikipedia.org/wiki/UTF-8#Description for encoding details.
        Throws:
        java.io.UTFDataFormatException