Class SerializationHelper
- java.lang.Object
-
- org.eclipse.persistence.internal.helper.SerializationHelper
-
public class SerializationHelper extends java.lang.ObjectProvide common functionalities for serialization of object.
This class throws exceptions for invalid
nullinputs. Each method documents its behavior in more detail.- Since:
- OracleAS 10.0.3
- Author:
- Steven Vo
-
-
Constructor Summary
Constructors Constructor Description SerializationHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Objectclone(java.io.Serializable object)Deep clone a Serializable object using serialization.static java.lang.Objectdeserialize(byte[] objectBytes)Deserialize an object from a byte arraystatic java.lang.Objectdeserialize(java.io.InputStream inputStream)Deserialze an object from an InputStreamstatic byte[]serialize(java.io.Serializable obj)Serialize the object to a byte arraystatic voidserialize(java.io.Serializable obj, java.io.OutputStream outputStream)Serialize the object to an OutputStream
-
-
-
Method Detail
-
clone
public static java.lang.Object clone(java.io.Serializable object) throws java.io.IOException, java.lang.ClassNotFoundExceptionDeep clone a Serializable object using serialization.
- Parameters:
the- serializable object- Returns:
- the deep cloned object
- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
serialize
public static void serialize(java.io.Serializable obj, java.io.OutputStream outputStream) throws java.io.IOExceptionSerialize the object to an OutputStream- Parameters:
obj- the object to serialize to bytesoutputStream- the stream to write to, can not be null- Throws:
java.io.IOException
-
serialize
public static byte[] serialize(java.io.Serializable obj) throws java.io.IOExceptionSerialize the object to a byte array- Parameters:
obj- the object to serialize to bytes- Returns:
- a byte[] of the obj
- Throws:
java.io.IOException
-
deserialize
public static java.lang.Object deserialize(java.io.InputStream inputStream) throws java.io.IOException, java.lang.ClassNotFoundExceptionDeserialze an object from an InputStream- Parameters:
inputStream- the serialized object input stream, must not be null- Returns:
- the deserialized object
- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
deserialize
public static java.lang.Object deserialize(byte[] objectBytes) throws java.io.IOException, java.lang.ClassNotFoundExceptionDeserialize an object from a byte array- Parameters:
objectBytes- the serialized object, can not be null- Returns:
- the deserialized object
- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
-