public final class SerializationUtils
extends java.lang.Object
SerializationUtils
that encapsulates common serialization operations
in one spot.Modifier and Type | Method and Description |
---|---|
static <T> T |
decodeAndSerializeObject(byte[] object,
CipherExecutor cipher,
java.lang.Class<? extends java.io.Serializable> type)
Decode and serialize object.
|
static <T> T |
deserialize(byte[] inBytes)
Deserialize an object.
|
static <T> T |
deserialize(java.io.InputStream inputStream)
Deserialize an object.
|
static <T> T |
deserializeAndCheckObject(byte[] object,
java.lang.Class<? extends java.io.Serializable> type)
Decode and serialize object.
|
static byte[] |
serialize(java.io.Serializable object)
Serialize an object.
|
static void |
serialize(java.io.Serializable object,
java.io.OutputStream outputStream)
Serialize an object.
|
static byte[] |
serializeAndEncodeObject(CipherExecutor<byte[],byte[]> cipher,
java.io.Serializable object)
Serialize and encode object.
|
public static byte[] serialize(java.io.Serializable object)
object
- The object to be serializedpublic static void serialize(java.io.Serializable object, java.io.OutputStream outputStream)
object
- The object to be serializedoutputStream
- The stream to receive the objectpublic static <T> T deserialize(byte[] inBytes)
T
- the type parameterinBytes
- The bytes to be deserializedpublic static <T> T deserialize(java.io.InputStream inputStream)
T
- the type parameterinputStream
- The stream to be deserializedpublic static byte[] serializeAndEncodeObject(CipherExecutor<byte[],byte[]> cipher, java.io.Serializable object)
cipher
- the cipherobject
- the objectpublic static <T> T decodeAndSerializeObject(byte[] object, CipherExecutor cipher, java.lang.Class<? extends java.io.Serializable> type)
T
- the type parameterobject
- the objectcipher
- the ciphertype
- the typepublic static <T> T deserializeAndCheckObject(byte[] object, java.lang.Class<? extends java.io.Serializable> type)
T
- the type parameterobject
- the objecttype
- the type