Package io.protostuff

Class StringSerializer.STRING

java.lang.Object
io.protostuff.StringSerializer.STRING
Enclosing class:
StringSerializer

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

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

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    deser(byte[] nonNullValue)
     
    static String
    deser(byte[] nonNullValue, int offset, int len)
     
    (package private) static String
    deserCustomOnly(byte[] nonNullValue)
    Deserialize using readUTF only.
    private static 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(String nonNullValue)
     

    Methods inherited from class java.lang.Object

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

    • CESU8_COMPAT

      static final boolean CESU8_COMPAT
  • Constructor Details

    • STRING

      private STRING()
  • Method Details

    • deser

      public static String deser(byte[] nonNullValue)
    • deser

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

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

      public static byte[] ser(String nonNullValue)
    • readUTF

      private static String readUTF(byte[] buffer, int offset, int len) throws 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:
      UTFDataFormatException