Package org.springframework.core.serializer

# Class DefaultSerializer

java.lang.Object
org.springframework.core.serializer.DefaultSerializer

All Implemented Interfaces:
  `Serializer<Object>`

public class DefaultSerializer extends Object implements Serializer<Object>
A `Serializer` implementation that writes an object to an output stream using Java serialization.

Since:
  3.0.5
Author:
  Gary Russell, Mark Fisher

## Constructor Summary

Constructors
Constructor
Description
`DefaultSerializer()`

## Method Summary

Modifier and Type
Method
Description
`void`
`serialize(Object object, OutputStream outputStream)`
Writes the source object to an output stream using Java serialization.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.springframework.core.serializer.Serializer

`serializeToByteArray`

## Constructor Details

### DefaultSerializer

public DefaultSerializer()

## Method Details

### 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
See Also:
  - `ObjectOutputStream.writeObject(Object)`