public class JavaSerializationCopier extends AbstractCopier<byte[]>
Beware that native serialization is slow and is provided for completeness. In practice, it is recommended that a higher performance alternative is used, which is provided by numerous external libraries.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
JavaSerializationCopier.ClassLoaderAwareObjectInputStream
An ObjectInputStream that instantiates using the supplied classloader.
|
| Constructor and Description |
|---|
JavaSerializationCopier() |
JavaSerializationCopier(Set<Class<?>> immutableClasses,
Map<Class<?>,Function<Object,Object>> deepCopyStrategies) |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
deserialize(byte[] data,
ClassLoader classLoader)
Deserializes the data using the provided classloader.
|
protected byte[] |
serialize(Object object)
Serializes the object.
|
canDeeplyCopy, copy, isImmutable, javaDeepCopyStrategies, javaImmutableClasses, roundtripprotected byte[] serialize(Object object)
AbstractCopierserialize in class AbstractCopier<byte[]>object - the object to serializeprotected Object deserialize(byte[] data, ClassLoader classLoader)
AbstractCopierdeserialize in class AbstractCopier<byte[]>data - the serialized bytesclassLoader - the classloader to create the instance with