Interface SessionSerializer

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T> T deserialize​(java.lang.Class<T> type, java.io.InputStream in)
      Reads the bytes of the given input stream, creating a new object.
      <T> void serialize​(java.lang.Class<T> type, T value, java.io.OutputStream out)
      Writes the given value to the output stream as bytes.
    • Method Detail

      • serialize

        <T> void serialize​(java.lang.Class<T> type,
                           T value,
                           java.io.OutputStream out)
                    throws java.lang.Exception
        Writes the given value to the output stream as bytes.
        Type Parameters:
        T - the type of the object
        Parameters:
        type - the declared type of the object
        value - the value to serialize
        out - the destination for the bytes
        Throws:
        java.lang.Exception - if the value could not be serialized
      • deserialize

        <T> T deserialize​(java.lang.Class<T> type,
                          java.io.InputStream in)
                   throws java.lang.Exception
        Reads the bytes of the given input stream, creating a new object.
        Type Parameters:
        T - the type of the object
        Parameters:
        type - the expected type of the object
        in - the source of the bytes
        Returns:
        the object
        Throws:
        java.io.IOException - any thrown by in
        java.lang.Exception - the the value could not be deserialized