Package org.springframework.core.serializer.support

# Class DeserializingConverter

java.lang.Object
org.springframework.core.serializer.support.DeserializingConverter

All Implemented Interfaces:
  `Converter<byte[],Object>`

public class DeserializingConverter extends Object implements Converter<byte[],Object>
A `Converter` that delegates to a `Deserializer` to convert data in a byte array to an object.

Since:
  3.0.5
Author:
  Gary Russell, Mark Fisher, Juergen Hoeller

## Constructor Summary

Constructors
Constructor
Description
`DeserializingConverter()`
Create a `DeserializingConverter` with default `ObjectInputStream` configuration, using the "latest user-defined ClassLoader".
`DeserializingConverter(ClassLoader classLoader)`
Create a `DeserializingConverter` for using an `ObjectInputStream` with the given `ClassLoader`.
`DeserializingConverter(Deserializer<Object> deserializer)`
Create a `DeserializingConverter` that delegates to the provided `Deserializer`.

## Method Summary

Modifier and Type
Method
Description
`Object`
`convert(byte[] source)`
Convert the source object of type `S` to target type `T`.

### 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.convert.converter.Converter

`andThen`

## Constructor Details

### DeserializingConverter

public DeserializingConverter()
Create a `DeserializingConverter` with default `ObjectInputStream` configuration, using the "latest user-defined ClassLoader".

See Also:
  - `DefaultDeserializer()`

### DeserializingConverter

public DeserializingConverter(@Nullable ClassLoader classLoader)
Create a `DeserializingConverter` for using an `ObjectInputStream` with the given `ClassLoader`.

Parameters:
  `classLoader` - the ClassLoader to use
Since:
  4.2.1
See Also:
  - `DefaultDeserializer(ClassLoader)`

### DeserializingConverter

public DeserializingConverter(Deserializer<Object> deserializer)
Create a `DeserializingConverter` that delegates to the provided `Deserializer`.

## Method Details

### convert

public Object convert(byte[] source)
Description copied from interface: `Converter`
Convert the source object of type `S` to target type `T`.

Specified by:
  `convert` in interface `Converter<byte[],Object>`
Parameters:
  `source` - the source object to convert, which must be an instance of `S` (never `null`)
Returns:
  the converted object, which must be an instance of `T` (potentially `null`)