Class SerializationUtil
- java.lang.Object
-
- org.apache.logging.log4j.util.internal.SerializationUtil
-
public final class SerializationUtil extends Object
Provides methods to increase the safety of object serialization/deserialization.
-
-
Field Summary
Fields Modifier and Type Field Description static List<String>REQUIRED_JAVA_CLASSESstatic List<String>REQUIRED_JAVA_PACKAGES
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidassertFiltered(ObjectInputStream stream)static ObjectreadWrappedObject(ObjectInputStream in)static StringstripArray(Class<?> clazz)Gets the class name of an array component recursively.static StringstripArray(String name)Gets the class name of an array component recursively.static voidwriteWrappedObject(Serializable obj, ObjectOutputStream out)
-
-
-
Method Detail
-
writeWrappedObject
public static void writeWrappedObject(Serializable obj, ObjectOutputStream out) throws IOException
- Throws:
IOException
-
readWrappedObject
public static Object readWrappedObject(ObjectInputStream in) throws IOException, ClassNotFoundException
- Throws:
IOExceptionClassNotFoundException
-
assertFiltered
public static void assertFiltered(ObjectInputStream stream)
-
stripArray
public static String stripArray(Class<?> clazz)
Gets the class name of an array component recursively.If
clazzis not an array class its name is returned.- Parameters:
clazz- the binary name of a class.
-
stripArray
public static String stripArray(String name)
Gets the class name of an array component recursively.If
nameis not the name of an array class it is returned unchanged.- Parameters:
name- the name of a class.- See Also:
Class.getName()
-
-