Package org.omegazero.common.util
Class SerializationUtil
java.lang.Object
org.omegazero.common.util.SerializationUtil
Utility functions for object serialization.
- Since:
- 2.11.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
deserialize
(byte[] data) Deserializes the given object data using anObjectInputStream
.static byte[]
Serializes the given object into a byte array using anObjectOutputStream
.
-
Method Details
-
serialize
Serializes the given object into a byte array using anObjectOutputStream
.- Parameters:
object
- The object- Returns:
- The serialized object data
- Throws:
IOException
- If serialization fails (for example because the object is not serializable)
-
deserialize
Deserializes the given object data using anObjectInputStream
.- Parameters:
data
- The serialized object data- Returns:
- The deserialized object
- Throws:
IOException
- If deserialization fails (for example because a serialized class is not found)
-