Interface Serializer<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getMIMEType​(T object)
      Returns the MIME type of the data read and written by this serializer.
      T readObject​(java.io.InputStream inputStream)
      Reads an object from an input stream.
      void writeObject​(T object, java.io.OutputStream outputStream)
      Writes an object to an output stream.
    • Method Detail

      • readObject

        T readObject​(java.io.InputStream inputStream)
              throws java.io.IOException,
                     SerializationException
        Reads an object from an input stream.
        Parameters:
        inputStream - The data stream from which the object will be read.
        Returns:
        The deserialized object.
        Throws:
        java.io.IOException - for any errors accessing or reading the object.
        SerializationException - for any formatting errors encountered while deserializing the object.
      • writeObject

        void writeObject​(T object,
                         java.io.OutputStream outputStream)
                  throws java.io.IOException,
                         SerializationException
        Writes an object to an output stream.
        Parameters:
        object - The object to serialize.
        outputStream - The data stream to which the object will be written.
        Throws:
        java.io.IOException - for any errors accessing or reading the object.
        SerializationException - for any formatting errors encountered while deserializing the object.
      • getMIMEType

        java.lang.String getMIMEType​(T object)
        Returns the MIME type of the data read and written by this serializer.
        Parameters:
        object - If provided, allows the serializer to attach parameters to the returned MIME type containing more detailed information about the data. If null, the base MIME type is returned.
        Returns:
        The MIME type of the current data.