public class SerializerHelper extends Object
Constructor and Description |
---|
SerializerHelper() |
Modifier and Type | Method and Description |
---|---|
static Class<?> |
readClass(ObjectInputStream in)
Deserializes a class reference serialized by
writeClass(ObjectOutputStream, Class) . |
static Class<?>[] |
readClassArray(ObjectInputStream in)
Deserializes a class references serialized by
writeClassArray(ObjectOutputStream, Class[]) . |
static Class<?> |
resolveClass(String className)
Resolves the class given by
className . |
static void |
writeClass(ObjectOutputStream out,
Class<?> cls)
Serializes the class reference so
readClass(ObjectInputStream)
can deserialize it. |
static void |
writeClassArray(ObjectOutputStream out,
Class<?>[] classes)
Serializes the class references so
readClassArray(ObjectInputStream) can deserialize it. |
public static void writeClass(ObjectOutputStream out, Class<?> cls) throws IOException
readClass(ObjectInputStream)
can deserialize it. Supports null class references.out
- The ObjectOutputStream
to serialize to.cls
- A class or null.IOException
- Rethrows any IOExceptions from the ObjectOutputStreampublic static void writeClassArray(ObjectOutputStream out, Class<?>[] classes) throws IOException
readClassArray(ObjectInputStream)
can deserialize it. Supports
null class arrays.out
- The ObjectOutputStream
to serialize to.classes
- An array containing class references or null.IOException
- Rethrows any IOExceptions from the ObjectOutputStreampublic static Class<?>[] readClassArray(ObjectInputStream in) throws ClassNotFoundException, IOException
writeClassArray(ObjectOutputStream, Class[])
. Supports null
class arrays.in
- ObjectInputStream
to read from.ClassNotFoundException
- If one of the classes could not be resolved.IOException
- Rethrows IOExceptions from the ObjectInputStreampublic static Class<?> resolveClass(String className) throws ClassNotFoundException
className
.className
- The fully qualified class name.Class
reference.ClassNotFoundException
- If the class could not be resolved.public static Class<?> readClass(ObjectInputStream in) throws IOException, ClassNotFoundException
writeClass(ObjectOutputStream, Class)
. Supports null class
references.in
- ObjectInputStream
to read from.ClassNotFoundException
- If the class could not be resolved.IOException
- Rethrows IOExceptions from the ObjectInputStreamCopyright © 2019 Vaadin Ltd. All rights reserved.