Package anbxj
Class Crypto_SerializationUtils
java.lang.Object
anbxj.Crypto_SerializationUtils
Utility methods for serializing/deserializing objects using standard Java
serialization. These are used by protocol-specific protobuf serializers to
embed cryptographic wrappers (e.g.,
SignedObject) as opaque bytes.-
Method Summary
Modifier and TypeMethodDescriptionstatic Objectdeserialize(byte[] data) Deserializes an object from a byte array.static byte[]Serializes an object to a byte array using Java object serialization.
-
Method Details
-
serialize
Serializes an object to a byte array using Java object serialization.- Parameters:
obj- the object to serialize (must implementSerializable)- Returns:
- the serialized bytes
- Throws:
IOException- if serialization fails
-
deserialize
Deserializes an object from a byte array.- Parameters:
data- the bytes produced byserialize(Object)- Returns:
- the deserialized object
- Throws:
IOException- if an I/O error occursClassNotFoundException- if the class of the serialized object cannot be found
-