|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jstatcom.util.SerializationHelper
public final class SerializationHelper
Helper methods for (de)serialization and de/encoding to strings.
| Constructor Summary | |
|---|---|
SerializationHelper()
|
|
| Method Summary | ||
|---|---|---|
static
|
decode(java.lang.String encodedString)
Decode Base64 encoded string (with encode). |
|
static java.lang.String |
encode(java.lang.Object o)
Base64 encoding of serializable objects. |
|
static byte[] |
getByteFromObject(java.lang.Object o)
Serializes o to a byte array representation. |
|
static
|
getObjectFromByteArray(byte[] byteArray)
Deserializes an object from the byte array representation of the serialized version. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SerializationHelper()
| Method Detail |
|---|
public static byte[] getByteFromObject(java.lang.Object o)
o to a byte array representation.
o - object to serialize
o
java.lang.IllegalArgumentException - if (!(o instanceof Serializable))public static <T> T getObjectFromByteArray(byte[] byteArray)
byteArray - byte array representation of serialized object
public static java.lang.String encode(java.lang.Object o)
o - serializable object, may be null
java.lang.IllegalArgumentException - if (o != null && !(o instanceof Serializable))public static <T> T decode(java.lang.String encodedString)
encode).
encodedString - may be null
T or null if argument
was null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||