|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atomikos.util.SerializationUtils
public class SerializationUtils
Mostly a copy/paste of Commons Lang SerializationUtils (v3.x).
| Constructor Summary | |
|---|---|
SerializationUtils()
|
|
| Method Summary | ||
|---|---|---|
static
|
deserialize(byte[] objectData)
Deserializes a single Object from an array of bytes. |
|
static byte[] |
serialize(Serializable obj)
Serializes an Object to a byte array for
storage/serialization. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SerializationUtils()
| Method Detail |
|---|
public static byte[] serialize(Serializable obj)
Serializes an Object to a byte array for
storage/serialization.
obj - the object to serialize to bytes
RuntimeException - (runtime) if the serialization failspublic static <T> T deserialize(byte[] objectData)
Deserializes a single Object from an array of bytes.
If the call site incorrectly types the return value, a ClassCastException is thrown from the call site.
Without Generics in this declaration, the call site must type cast and can cause the same ClassCastException.
Note that in both cases, the ClassCastException is in the call site, not in this method.
T - the object type to be deserializedobjectData - the serialized object, must not be null
IllegalArgumentException - if objectData is null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||