Top Description Constructors Methods
org.eclipse.persistence.internal.helper

public Class SerializationHelper

extends Object
Class Inheritance
Imports
java.io.ByteArrayInputStream, .ByteArrayOutputStream, .IOException, .InputStream, .ObjectInputStream, .ObjectOutputStream, .OutputStream, .Serializable, org.eclipse.persistence.exceptions.ValidationException

Provide common functionalities for serialization of object.

This class throws exceptions for invalid null inputs. Each method documents its behavior in more detail.

Author
Steven Vo
Since
OracleAS 10.0.3

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Object

Returns:

the deep cloned object
clone
(Serializable
the serializable object
object
)

Deep clone a Serializable object using serialization.

public static Object

Returns:

the deserialized object
deserialize
(InputStream
the serialized object input stream, must not be null
inputStream
)

Deserialze an object from an InputStream

public static Object

Returns:

the deserialized object
deserialize
(byte[]
the serialized object, can not be null
objectBytes
)

Deserialize an object from a byte array

public static void
serialize(Serializable
the object to serialize to bytes
obj
,
OutputStream
the stream to write to, can not be null
outputStream
)

Serialize the object to an OutputStream

public static byte[]

Returns:

a byte[] of the obj
serialize
(Serializable
the object to serialize to bytes
obj
)

Serialize the object to a byte array

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SerializationHelperback to summary
public SerializationHelper()

Method Detail

cloneback to summary
public static Object clone(Serializable object) throws IOException, ClassNotFoundException

Deep clone a Serializable object using serialization.

Parameters
object:Serializable

the serializable object

Returns:Object

the deep cloned object

deserializeback to summary
public static Object deserialize(InputStream inputStream) throws IOException, ClassNotFoundException

Deserialze an object from an InputStream

Parameters
inputStream:InputStream

the serialized object input stream, must not be null

Returns:Object

the deserialized object

deserializeback to summary
public static Object deserialize(byte[] objectBytes) throws IOException, ClassNotFoundException

Deserialize an object from a byte array

Parameters
objectBytes:byte[]

the serialized object, can not be null

Returns:Object

the deserialized object

serializeback to summary
public static void serialize(Serializable obj, OutputStream outputStream) throws IOException

Serialize the object to an OutputStream

Parameters
obj:Serializable

the object to serialize to bytes

outputStream:OutputStream

the stream to write to, can not be null

serializeback to summary
public static byte[] serialize(Serializable obj) throws IOException

Serialize the object to a byte array

Parameters
obj:Serializable

the object to serialize to bytes

Returns:byte[]

a byte[] of the obj