Interface SimpleVersionedSerializer<E>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      E deserialize​(int version, byte[] serialized)
      De-serializes the given data (bytes) which was serialized with the scheme of the indicated version.
      int getVersion()
      Gets the version with which this serializer serializes.
      byte[] serialize​(E obj)
      Serializes the given object.
    • Method Detail

      • getVersion

        int getVersion()
        Gets the version with which this serializer serializes.
        Specified by:
        getVersion in interface Versioned
        Returns:
        The version of the serialization schema.
      • serialize

        byte[] serialize​(E obj)
                  throws IOException
        Serializes the given object. The serialization is assumed to correspond to the current serialization version (as returned by getVersion().
        Parameters:
        obj - The object to serialize.
        Returns:
        The serialized data (bytes).
        Throws:
        IOException - Thrown, if the serialization fails.
      • deserialize

        E deserialize​(int version,
                      byte[] serialized)
               throws IOException
        De-serializes the given data (bytes) which was serialized with the scheme of the indicated version.
        Parameters:
        version - The version in which the data was serialized
        serialized - The serialized data
        Returns:
        The deserialized object
        Throws:
        IOException - Thrown, if the deserialization fails.