Interface ElsaSerializer

  • All Known Implementing Classes:
    ElsaSerializerBase, ElsaSerializerPojo

    public interface ElsaSerializer
    Elsa serializer and deserializer. It turns object instance into binary form and vice versa.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <E> E clone​(E obj)
      Deep binary clone.
      <E> E deserialize​(java.io.DataInput input)
      Reads binary data from input and converts them into object instances.
      void serialize​(java.io.DataOutput output, java.lang.Object obj)
      Converts object instance into binary form
    • Method Detail

      • serialize

        void serialize​(java.io.DataOutput output,
                       java.lang.Object obj)
                throws java.io.IOException
        Converts object instance into binary form
        Parameters:
        output - output into which binary data will be written while object is serialized
        obj - object instance to be serialized
        Throws:
        java.io.IOException - an exception from underlying stream
      • deserialize

        <E> E deserialize​(java.io.DataInput input)
                   throws java.io.IOException
        Reads binary data from input and converts them into object instances.
        Type Parameters:
        E - type of deserialized object
        Parameters:
        input - input to read data from
        Returns:
        deserialized object
        Throws:
        java.io.IOException - an exception from underlying stream
      • clone

        <E> E clone​(E obj)
             throws java.io.IOException
        Deep binary clone. Serialize object into binary form, and then use data to deserialize it. Returned object should be equal to original, but is completely different instance.
        Type Parameters:
        E - type of cloned object
        Parameters:
        obj - object instance to be cloned
        Returns:
        deep clone
        Throws:
        java.io.IOException - an exception from underlying stream