public class SerializableMisc extends Object
Utilities for manipulating Serializable objects.
| Constructor and Description |
|---|
SerializableMisc() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Serializable> |
read(File file)
Reads an object from the given file.
|
static <T extends Serializable> |
write(File file,
T object)
Writes the given object to the given file.
|
static void |
writeThrowable(File file,
Throwable object)
Writes an exception to file, even if that exception isn’t serializable.
|
public static <T extends Serializable> void write(File file, T object) throws IOException
Writes the given object to the given file.
IOExceptionpublic static <T extends Serializable> T read(File file) throws ClassNotFoundException, IOException
Reads an object from the given file.
ClassNotFoundExceptionIOExceptionpublic static void writeThrowable(File file, Throwable object) throws IOException
Writes an exception to file, even if that exception isn’t serializable.
IOException