|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.lang.SerializationUtils
Methods that assist with the serialization process, or perform additional functionality based on serialization.
Constructor Summary | |
private |
SerializationUtils()
Constructor for SerializationUtils is private |
Method Summary | |
static Object |
clone(Serializable object)
Deep clone an object using serialization. |
static Object |
deserialize(byte[] objectData)
Deserializes a single object from an array of bytes. |
static Object |
deserialize(InputStream inputStream)
Deserializes an object from the specified stream. |
static byte[] |
serialize(Serializable obj)
Serializes an object to a byte array for storage/serialization. |
static void |
serialize(Serializable obj,
OutputStream outputStream)
Serializes an object to the specified stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
private SerializationUtils()
Method Detail |
public static Object clone(Serializable object)
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
.
object
- the Serializable
object to clone
SerializationException
- (runtime) if the serialization failspublic static void serialize(Serializable obj, OutputStream outputStream)
obj
- the object to serialize to bytesoutputStream
- the stream to write to
SerializationException
- (runtime) if the serialization failspublic static byte[] serialize(Serializable obj)
obj
- the object to serialize to bytes
SerializationException
- (runtime) if the serialization failspublic static Object deserialize(InputStream inputStream)
inputStream
- the serialized object input stream
SerializationException
- (runtime) if the serialization failspublic static Object deserialize(byte[] objectData)
objectData
- the serialized object
SerializationException
- (runtime) if the serialization fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |