Top Description Fields Constructors Methods
org.springframework.core.serializer

public Class DefaultDeserializer

extends Object
implements Deserializer<Object>
Class Inheritance
All Implemented Interfaces
org.springframework.core.serializer.Deserializer
Imports
java.io.IOException, .InputStream, .ObjectInputStream, org.springframework.core.ConfigurableObjectInputStream, org.springframework.lang.Nullable

A default Deserializer implementation that reads an input stream using Java serialization.
Authors
Gary Russell, Mark Fisher, Juergen Hoeller
Since
3.0.5
See Also
ObjectInputStream

Field Summary

Modifier and TypeField and Description
private final ClassLoader

Constructor Summary

AccessConstructor and Description
public
DefaultDeserializer()

Create a DefaultDeserializer with default ObjectInputStream configuration, using the "latest user-defined ClassLoader".

public
DefaultDeserializer(ClassLoader
the ClassLoader to use
classLoader
)

Create a DefaultDeserializer for using an ObjectInputStream with the given ClassLoader.

Method Summary

Modifier and TypeMethod and Description
public Object
deserialize(InputStream
the input stream
inputStream
)

Implements org.springframework.core.serializer.Deserializer.deserialize.

Read from the supplied InputStream and deserialize the contents into an object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classLoaderback to summary
private final ClassLoader classLoader
Annotations
@Nullable

Constructor Detail

DefaultDeserializerback to summary
public DefaultDeserializer()

Create a DefaultDeserializer with default ObjectInputStream configuration, using the "latest user-defined ClassLoader".

DefaultDeserializerback to summary
public DefaultDeserializer(ClassLoader classLoader)

Create a DefaultDeserializer for using an ObjectInputStream with the given ClassLoader.

Parameters
classLoader:ClassLoader

the ClassLoader to use

Since
4.2.1
See Also
ConfigurableObjectInputStream#ConfigurableObjectInputStream(InputStream, ClassLoader)

Method Detail

deserializeback to summary
public Object deserialize(InputStream inputStream) throws IOException

Implements org.springframework.core.serializer.Deserializer.deserialize.

Read from the supplied InputStream and deserialize the contents into an object.

Parameters
inputStream:InputStream

Doc from org.springframework.core.serializer.Deserializer.deserialize.

the input stream

Returns:Object

Doc from org.springframework.core.serializer.Deserializer.deserialize.

the deserialized object

Annotations
@Override
Exceptions
IOException:

Doc from org.springframework.core.serializer.Deserializer.deserialize.

in case of errors reading from the stream

See Also
ObjectInputStream#readObject()