Provide common functionalities for serialization of object.
This class throws exceptions for invalid null inputs.
Each method documents its behavior in more detail.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static Object | Returns: the deep cloned objectthe serializable object object)Deep clone a Serializable object using serialization. |
| public static Object | Returns: the deserialized objectthe serialized object input stream, must not be null inputStream)Deserialze an object from an InputStream |
| public static Object | Returns: the deserialized objectthe 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 objthe object to serialize to bytes obj)Serialize the object to a byte array |
| SerializationHelper | back to summary |
|---|---|
| public SerializationHelper() | |
| clone | back to summary |
|---|---|
| public static Object clone(Serializable object) throws IOException, ClassNotFoundException Deep clone a Serializable object using serialization.
| |
| deserialize | back to summary |
|---|---|
| public static Object deserialize(InputStream inputStream) throws IOException, ClassNotFoundException Deserialze an object from an InputStream
| |
| deserialize | back to summary |
|---|---|
| public static Object deserialize(byte[] objectBytes) throws IOException, ClassNotFoundException Deserialize an object from a byte array
| |
| serialize | back to summary |
|---|---|
| public static void serialize(Serializable obj, OutputStream outputStream) throws IOException Serialize the object to an OutputStream
| |
| serialize | back to summary |
|---|---|
| public static byte[] serialize(Serializable obj) throws IOException Serialize the object to a byte array
| |