Class SerializationUtils
- java.lang.Object
-
- org.apereo.cas.util.serialization.SerializationUtils
-
public class SerializationUtils extends java.lang.ObjectThis isSerializationUtilsthat encapsulates common serialization operations in one spot.- Since:
- 5.0.0
-
-
Constructor Summary
Constructors Constructor Description SerializationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends java.io.Serializable>
TdecodeAndDeserializeObject(byte[] object, org.apereo.cas.util.crypto.CipherExecutor cipher, java.lang.Class<T> type)Decode and deserialize object t.static <T extends java.io.Serializable>
TdecodeAndDeserializeObject(byte[] object, org.apereo.cas.util.crypto.CipherExecutor cipher, java.lang.Class<T> type, java.lang.Object[] parameters)Decode and serialize object.static <T> Tdeserialize(byte[] inBytes, java.lang.Class<T> clazz)Deserialize an object.static <T> Tdeserialize(java.io.InputStream inputStream, java.lang.Class<T> clazz)Deserialize an object.static <T extends java.io.Serializable>
TdeserializeAndCheckObject(byte[] object, java.lang.Class<T> type)Decode and serialize object.static byte[]serialize(java.io.Serializable object)Serialize an object.static voidserialize(java.io.Serializable object, java.io.OutputStream outputStream)Serialize an object.static byte[]serializeAndEncodeObject(org.apereo.cas.util.crypto.CipherExecutor cipher, java.io.Serializable object)Serialize and encode object byte [ ].static byte[]serializeAndEncodeObject(org.apereo.cas.util.crypto.CipherExecutor cipher, java.io.Serializable object, java.lang.Object[] parameters)Serialize and encode object.
-
-
-
Method Detail
-
serialize
public static byte[] serialize(java.io.Serializable object)
Serialize an object.- Parameters:
object- The object to be serialized- Returns:
- the +byte[]+ containing the object
- Since:
- 5.0.0
-
serialize
public static void serialize(java.io.Serializable object, java.io.OutputStream outputStream)Serialize an object.- Parameters:
object- The object to be serializedoutputStream- The stream to receive the object- Since:
- 5.0.0
-
deserialize
public static <T> T deserialize(byte[] inBytes, java.lang.Class<T> clazz)Deserialize an object.- Type Parameters:
T- the type parameter- Parameters:
inBytes- The bytes to be de-serializedclazz- the clazz- Returns:
- the object
- Since:
- 5.0.0
-
deserialize
public static <T> T deserialize(java.io.InputStream inputStream, java.lang.Class<T> clazz)Deserialize an object.- Type Parameters:
T- the type parameter- Parameters:
inputStream- The stream to be de-serializedclazz- the clazz- Returns:
- the object
- Since:
- 5.0.0
-
serializeAndEncodeObject
public static byte[] serializeAndEncodeObject(org.apereo.cas.util.crypto.CipherExecutor cipher, java.io.Serializable object, java.lang.Object[] parameters)Serialize and encode object.- Parameters:
cipher- the cipherobject- the objectparameters- the parameters- Returns:
- the byte []
- Since:
- 4.2
-
serializeAndEncodeObject
public static byte[] serializeAndEncodeObject(org.apereo.cas.util.crypto.CipherExecutor cipher, java.io.Serializable object)Serialize and encode object byte [ ].- Parameters:
cipher- the cipherobject- the object- Returns:
- the byte []
-
decodeAndDeserializeObject
public static <T extends java.io.Serializable> T decodeAndDeserializeObject(byte[] object, org.apereo.cas.util.crypto.CipherExecutor cipher, java.lang.Class<T> type, java.lang.Object[] parameters)Decode and serialize object.- Type Parameters:
T- the type parameter- Parameters:
object- the objectcipher- the ciphertype- the typeparameters- the parameters- Returns:
- the t
- Since:
- 4.2
-
decodeAndDeserializeObject
public static <T extends java.io.Serializable> T decodeAndDeserializeObject(byte[] object, org.apereo.cas.util.crypto.CipherExecutor cipher, java.lang.Class<T> type)Decode and deserialize object t.- Type Parameters:
T- the type parameter- Parameters:
object- the objectcipher- the ciphertype- the type- Returns:
- the t
-
deserializeAndCheckObject
public static <T extends java.io.Serializable> T deserializeAndCheckObject(byte[] object, java.lang.Class<T> type)Decode and serialize object.- Type Parameters:
T- the type parameter- Parameters:
object- the objecttype- the type- Returns:
- the t
- Since:
- 4.2
-
-