org.springframework.core.serializer

Class DefaultSerializer

  • All Implemented Interfaces:
    Serializer< Object>

    public class DefaultSerializer
    extends Object
    implements Serializer<Object>
    Serializer that writes an object to an output stream using Java Serialization.
    Since:
    3.0.5
    Author:
    Gary Russell, Mark Fisher
    • Constructor Detail

      • DefaultSerializer

        public DefaultSerializer()
    • Method Detail

      • serialize

        public void serialize(Object object,
                     OutputStream outputStream)
                       throws IOException
        Writes the source object to an output stream using Java Serialization. The source object must implement Serializable.
        Specified by:
        serialize in interface  Serializer<Object>
        Parameters:
        object - the object to serialize
        outputStream - the output stream
        Throws:
        IOException - in case of errors writing to the stream