Package org.springframework.amqp.utils
Class SerializationUtils
- java.lang.Object
-
- org.springframework.amqp.utils.SerializationUtils
-
public final class SerializationUtils extends java.lang.ObjectStatic utility to help with serialization.- Author:
- Dave Syer, Gary Russell
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckAllowedList(java.lang.Class<?> clazz, java.util.Set<java.lang.String> patterns)Verify that the class is in the allowed list.static java.lang.Objectdeserialize(byte[] bytes)Deserialize the bytes.static java.lang.Objectdeserialize(java.io.InputStream inputStream, java.util.Set<java.lang.String> allowedListPatterns, java.lang.ClassLoader classLoader)Deserialize the stream.static java.lang.Objectdeserialize(java.io.ObjectInputStream stream)Deserialize the stream.static byte[]serialize(java.lang.Object object)Serialize the object provided.
-
-
-
Method Detail
-
serialize
public static byte[] serialize(java.lang.Object object)
Serialize the object provided.- Parameters:
object- the object to serialize- Returns:
- an array of bytes representing the object in a portable fashion
-
deserialize
public static java.lang.Object deserialize(byte[] bytes)
Deserialize the bytes.- Parameters:
bytes- a serialized object created- Returns:
- the result of deserializing the bytes
-
deserialize
public static java.lang.Object deserialize(java.io.ObjectInputStream stream)
Deserialize the stream.- Parameters:
stream- an object stream created from a serialized object- Returns:
- the result of deserializing the bytes
-
deserialize
public static java.lang.Object deserialize(java.io.InputStream inputStream, java.util.Set<java.lang.String> allowedListPatterns, java.lang.ClassLoader classLoader) throws java.io.IOExceptionDeserialize the stream.- Parameters:
inputStream- the stream.allowedListPatterns- allowed classes.classLoader- the class loader.- Returns:
- the result.
- Throws:
java.io.IOException- IO Exception.- Since:
- 2.1
-
checkAllowedList
public static void checkAllowedList(java.lang.Class<?> clazz, java.util.Set<java.lang.String> patterns)Verify that the class is in the allowed list.- Parameters:
clazz- the class.patterns- the patterns.- Since:
- 2.1
-
-