public class SerializationUtils
extends java.lang.Object
copy from org.springframework.util.SerializationUtils
| 构造器和说明 |
|---|
SerializationUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T extends java.io.Serializable> |
clone(T object)
Deep clone an
Object using serialization. |
static java.lang.Object |
deserialize(byte[] bytes)
Deserialize the byte array into an object.
|
static byte[] |
serialize(java.lang.Object object)
Serialize the given object to a byte array.
|
public static <T extends java.io.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(java.lang.Object object)
object - the object to serializepublic static java.lang.Object deserialize(byte[] bytes)
bytes - a serialized object