@Deprecated public class DefaultSerializationStrategy extends Object implements SerializationStrategy
SerializationStrategy
which uses the built-in Java serialization mechanism.
Note that this class should not be used if data for deserialization comes from an untrusted source.
Instead, please use WhitelistedSerializationStrategy
with a list of allowed classes for deserialization.
Constructor and Description |
---|
DefaultSerializationStrategy()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected ObjectInputStream |
createObjectInputStream(byte[] byteArray)
Deprecated.
Creates an
ObjectInputStream for deserialization. |
<T> T |
deserialize(byte[] byteArray)
Deprecated.
Deserializes an object from a byte array.
|
byte[] |
serialize(Object state)
Deprecated.
Serializes an object.
|
public byte[] serialize(Object state)
SerializationStrategy
serialize
in interface SerializationStrategy
state
- The object to be serialized.public <T> T deserialize(byte[] byteArray)
SerializationStrategy
deserialize
in interface SerializationStrategy
T
- The type of the object.byteArray
- The byte array.protected ObjectInputStream createObjectInputStream(byte[] byteArray) throws IOException
ObjectInputStream
for deserialization.byteArray
- Data to be deserialized.ObjectInputStream
which should be used for deserialization.IOException
- If something went wrong.Copyright © 2019. All rights reserved.