public class Serializer extends Object
| Constructor and Description |
|---|
Serializer() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
deserializeFromByteArray(byte[] bytes)
Deserialize a single object from a byte array
|
static String |
deserializeToString(byte[] bytes,
Charset charset)
Deserialize a string from a byte array
|
static byte[] |
serializeString(String string,
Charset charset)
Serialize a string to a byte array
|
static <T> byte[] |
serializeToByteArray(T r)
Serialize a single object to a byte array
|
public static <T> T deserializeFromByteArray(byte[] bytes)
T - type of deserialized objectbytes - bytes to deserializepublic static <T> byte[] serializeToByteArray(T r)
T - type of deserialized objectr - object to serializepublic static String deserializeToString(byte[] bytes, Charset charset)
bytes - bytes to deserializecharset - string character setCopyright © 2015. All rights reserved.