public class ObjectUtil
extends java.lang.Object
Constructor and Description |
---|
ObjectUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
byteArrayToObject(byte[] data)
De-serialize an object from byte array.
|
static <T> T |
clone(T source)
Clone an object by invoking it's
clone() method, even if it is not overridden. |
static <T extends java.io.Serializable> |
cloneViaSerialization(T obj)
Create object copy using serialization mechanism.
|
static byte[] |
objectToByteArray(java.lang.Object obj)
Serialize an object to byte array.
|
static java.lang.Object |
readObject(java.io.File source)
Reads serialized object from the file.
|
static java.lang.Object |
readObject(java.lang.String source) |
static void |
writeObject(java.io.File dest,
java.lang.Object object)
Writes serializable object to a file.
|
static void |
writeObject(java.lang.String dest,
java.lang.Object object) |
public static <T> T clone(T source) throws java.lang.CloneNotSupportedException
clone()
method, even if it is not overridden.java.lang.CloneNotSupportedException
public static <T extends java.io.Serializable> T cloneViaSerialization(T obj) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public static void writeObject(java.lang.String dest, java.lang.Object object) throws java.io.IOException
java.io.IOException
writeObject(java.io.File, Object)
public static void writeObject(java.io.File dest, java.lang.Object object) throws java.io.IOException
java.io.IOException
public static java.lang.Object readObject(java.lang.String source) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
readObject(java.io.File)
public static java.lang.Object readObject(java.io.File source) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public static byte[] objectToByteArray(java.lang.Object obj) throws java.io.IOException
java.io.IOException
public static java.lang.Object byteArrayToObject(byte[] data) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
Copyright © 2003-present Jodd Team