Class StringCodec

  • All Implemented Interfaces:
    Codec<java.lang.String>

    public class StringCodec
    extends java.lang.Object
    implements Codec<java.lang.String>
    Implementation of a Marshaller for Strings
    • Constructor Summary

      Constructors 
      Constructor Description
      StringCodec()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String decode​(java.io.DataInput dataIn)
      Read the entry from the RawContainer
      java.lang.String deepCopy​(java.lang.String source)  
      void encode​(java.lang.String object, java.io.DataOutput dataOut)
      Write the payload of this entry to the RawContainer
      int estimatedSize​(java.lang.String object)  
      int getFixedSize()  
      boolean isDeepCopySupported()  
      boolean isEstimatedSizeSupported()  
      • Methods inherited from class java.lang.Object

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

    • Constructor Detail

      • StringCodec

        public StringCodec()
    • Method Detail

      • encode

        public void encode​(java.lang.String object,
                           java.io.DataOutput dataOut)
                    throws java.io.IOException
        Write the payload of this entry to the RawContainer
        Specified by:
        encode in interface Codec<java.lang.String>
        Parameters:
        object -
        dataOut -
        Throws:
        java.io.IOException
      • decode

        public java.lang.String decode​(java.io.DataInput dataIn)
                                throws java.io.IOException
        Read the entry from the RawContainer
        Specified by:
        decode in interface Codec<java.lang.String>
        Parameters:
        dataIn -
        Returns:
        unmarshalled object
        Throws:
        java.io.IOException
      • getFixedSize

        public int getFixedSize()
        Specified by:
        getFixedSize in interface Codec<java.lang.String>
        Returns:
        -1 if the object do not always marshall to a fixed size, otherwise return that fixed size.
      • deepCopy

        public java.lang.String deepCopy​(java.lang.String source)
        Specified by:
        deepCopy in interface Codec<java.lang.String>
        Returns:
        a deep copy of the source object. If the source is immutable the same source should be returned.
      • estimatedSize

        public int estimatedSize​(java.lang.String object)
        Specified by:
        estimatedSize in interface Codec<java.lang.String>
        Returns:
        the estimated marshaled size of the object.