public final class SerializationKit extends Object
copy from spring-core#org.springframework.util.SerializationKit version 5.2.2
| Modifier and Type | Method and Description |
|---|---|
static <T extends Serializable> |
clone(T object)
Deep clone an
Object using serialization. |
static Object |
deserialize(byte[] bytes)
Deserialize the byte array into an object.
|
static byte[] |
serialize(Object object)
Serialize the given object to a byte array.
|
public static <T extends Serializable> T clone(T object)
Object using serialization.
This is many times slower than writing clone methods by hand
on all objects in your object graph. However, for complex object
graphs, or for those that don't support deep cloning this can
be a simple alternative implementation. Of course all the objects
must be Serializable.
T - the type of the object involvedobject - the Serializable object to clonepublic static byte[] serialize(Object object)
object - the object to serializepublic static Object deserialize(byte[] bytes)
bytes - a serialized objectCopyright © 2021. All rights reserved.