Class DefaultDeserializer
java.lang.Object
org.springframework.core.serializer.DefaultDeserializer
- All Implemented Interfaces:
Deserializer<Object>
A default
Deserializer implementation that reads an input stream
using Java serialization.- Since:
- 3.0.5
- Author:
- Gary Russell, Mark Fisher, Juergen Hoeller
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate aDefaultDeserializerwith defaultObjectInputStreamconfiguration, using the "latest user-defined ClassLoader".DefaultDeserializer(@Nullable ClassLoader classLoader) DefaultDeserializer(@Nullable ClassLoader classLoader, @Nullable ObjectInputFilter objectInputFilter) -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(InputStream inputStream) Read from the suppliedInputStreamand deserialize the contents into an object.final @Nullable ClassLoaderReturn theClassLoaderto use for deserialization, ornullto use the "latest user-defined ClassLoader".final @Nullable ObjectInputFilterReturn theObjectInputFilterto apply to theObjectInputStream, if any.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Deserializer
deserializeFromByteArray
-
Constructor Details
-
DefaultDeserializer
public DefaultDeserializer()Create aDefaultDeserializerwith defaultObjectInputStreamconfiguration, using the "latest user-defined ClassLoader". -
DefaultDeserializer
- Parameters:
classLoader- the ClassLoader to use- Since:
- 4.2.1
- See Also:
-
DefaultDeserializer
public DefaultDeserializer(@Nullable ClassLoader classLoader, @Nullable ObjectInputFilter objectInputFilter) - Parameters:
classLoader- the ClassLoader to useobjectInputFilter- a custom ObjectInputFilter to apply- Since:
- 7.0.9
- See Also:
-
-
Method Details
-
getClassLoader
Return theClassLoaderto use for deserialization, ornullto use the "latest user-defined ClassLoader".- Since:
- 6.2.19
- See Also:
-
getObjectInputFilter
Return theObjectInputFilterto apply to theObjectInputStream, if any.- Since:
- 7.0.9
- See Also:
-
deserialize
Read from the suppliedInputStreamand deserialize the contents into an object.- Specified by:
deserializein interfaceDeserializer<Object>- Parameters:
inputStream- the input stream- Returns:
- the deserialized object
- Throws:
IOException- in case of errors reading from the stream- See Also:
-