public class Serializables extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T extends Serializable> |
deserialize(byte[] bytes)
Utility for returning a Serializable object from a byte array.
|
static <T extends Serializable> |
deserialize(byte[] bytes,
boolean compressed)
Utility for returning a Serializable object from a byte array.
|
static <T extends Serializable> |
fromBase64(byte[] bytes)
Utility for returning a Serializable object from a byte array.
|
static byte[] |
serialize(Serializable serializable)
Utility for turning a serializable object into a byte array.
|
static byte[] |
serialize(Serializable serializable,
boolean compress)
Utility for turning a serializable object into a byte array.
|
static byte[] |
toBase64(Serializable serializable)
Utility for returning a Serializable object from a base 64 encoded byte array.
|
public static byte[] serialize(Serializable serializable) throws IOException
IOExceptionpublic static byte[] serialize(Serializable serializable, boolean compress) throws IOException
compress option is selected
then the bytes will be run through gzip compression.IOExceptionpublic static <T extends Serializable> T deserialize(byte[] bytes) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic static <T extends Serializable> T deserialize(byte[] bytes, boolean compressed) throws IOException, ClassNotFoundException
compressed option if the
data was originally compresses when using the serialize(Serializable, boolean) method.IOExceptionClassNotFoundExceptionpublic static byte[] toBase64(Serializable serializable) throws IOException
IOExceptionpublic static <T extends Serializable> T fromBase64(byte[] bytes) throws IOException, ClassNotFoundException
toBase64(Serializable) method.IOExceptionClassNotFoundExceptionCopyright © 2018 Calrissian. All rights reserved.