Interface Serializer<T>

  • Type Parameters:
    T - the object type
    All Known Implementing Classes:
    DefaultSerializer, SerializationDelegate
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    public interface Serializer<T>
    A strategy interface for streaming an object to an OutputStream.
    Gary Russell, Mark Fisher
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      void serialize(T object, outputStream)
      Write an object of type T to the given OutputStream.
    • Method Detail

      • serialize

        void serialize(T object,
        Write an object of type T to the given OutputStream.

        Note: Implementations should not close the given OutputStream (or any decorators of that OutputStream) but rather leave this up to the caller.

        object - the object to serialize
        outputStream - the output stream
        Throws: - in case of errors writing to the stream