Top Description Methods
org.springframework.core.serializer

public Interface Deserializer<T>

Known Direct Implementers
org.springframework.core.serializer.support.SerializationDelegate, org.springframework.core.serializer.DefaultDeserializer
Annotations
@FunctionalInterface
Type Parameters
<T>
the object type
Imports
java.io.ByteArrayInputStream, .IOException, .InputStream

A strategy interface for converting from data in an InputStream to an Object.
Authors
Gary Russell, Mark Fisher, Juergen Hoeller
Since
3.0.5
See Also
Serializer

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

the deserialized object
deserialize
(InputStream
the input stream
inputStream
)

Read (assemble) an object of type T from the given InputStream.

public default T

Returns:

the deserialized object
deserializeFromByteArray
(byte[]
the byte array
serialized
)

Read (assemble) an object of type T from the given byte array.

Method Detail

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

Read (assemble) an object of type T from the given InputStream.

Note

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

Parameters
inputStream:InputStream

the input stream

Returns:T

the deserialized object

Exceptions
IOException:
in case of errors reading from the stream
deserializeFromByteArrayback to summary
public default T deserializeFromByteArray(byte[] serialized) throws IOException

Read (assemble) an object of type T from the given byte array.

Parameters
serialized:byte[]

the byte array

Returns:T

the deserialized object

Exceptions
IOException:
in case of deserialization failure
Since
5.2.7