Interface Codec<T>

    • Method Detail

      • encode

        void encode​(T object,
                    java.io.DataOutput dataOut)
             throws java.io.IOException
        Write the payload of the object to the DataOutput stream.
        Parameters:
        object -
        dataOut -
        Throws:
        java.io.IOException
      • decode

        T decode​(java.io.DataInput dataIn)
          throws java.io.IOException
        Read the payload of the object from the DataInput stream.
        Parameters:
        dataIn -
        Returns:
        unmarshalled object
        Throws:
        java.io.IOException
      • getFixedSize

        int getFixedSize()
        Returns:
        -1 if the object do not always marshall to a fixed size, otherwise return that fixed size.
      • isEstimatedSizeSupported

        boolean isEstimatedSizeSupported()
        Returns:
        true if the estimatedSize(Object) operation is supported.
      • estimatedSize

        int estimatedSize​(T object)
        Parameters:
        object -
        Returns:
        the estimated marshaled size of the object.
      • isDeepCopySupported

        boolean isDeepCopySupported()
        Returns:
        true if the deepCopy(Object) operations is supported.
      • deepCopy

        T deepCopy​(T source)
        Returns:
        a deep copy of the source object. If the source is immutable the same source should be returned.