java.lang.Object
com.pervasive.datarush.commons.util.SerializationUtil
Miscellaneous serialization utilities
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Tclone(T o) Performs a deep copy of the given object via serialization.static ObjectfromBase64(String str) Creates an object from a base64 encoded byte array.static ObjectfromBytes(byte[] bytes) Creates an object from a byte array.static StringCreates a string consisting of the serialized form of the given object.static byte[]Creates a byte array consisting of the serialized form of the given object.
-
Method Details
-
clone
public static <T> T clone(T o) Performs a deep copy of the given object via serialization.- Type Parameters:
T- the type of the object- Parameters:
o- the object to clone- Returns:
- a copy of the original object
-
toBase64
Creates a string consisting of the serialized form of the given object.- Parameters:
object- the object to serialize- Returns:
- a string consisting of the serialized form of the given object.
-
toBytes
Creates a byte array consisting of the serialized form of the given object.- Parameters:
object- the object to serialize- Returns:
- a byte array consisting of the serialized form of the given object.
-
fromBytes
Creates an object from a byte array.- Parameters:
bytes- byte array consisting of the serialized form of a java object.- Returns:
- the object
- Throws:
RuntimeException- if errors occur during deserialization
-
fromBase64
Creates an object from a base64 encoded byte array.- Parameters:
str- string consisting of the base64-encoded serialized form of a java object.- Returns:
- the object
- Throws:
RuntimeException- if errors occur during deserialization
-