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