Package com.diffplug.gradle
Class SerializableMisc
- java.lang.Object
-
- com.diffplug.gradle.SerializableMisc
-
public class SerializableMisc extends Object
Utilities for manipulatingSerializable
objects.
-
-
Constructor Summary
Constructors Constructor Description SerializableMisc()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends Serializable>
Tread(File file)
Reads an object from the given file.static <T extends Serializable>
voidwrite(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.
-
-
-
Method Detail
-
write
public static <T extends Serializable> void write(File file, T object) throws IOException
Writes the given object to the given file.- Throws:
IOException
-
read
public static <T extends Serializable> T read(File file) throws ClassNotFoundException, IOException
Reads an object from the given file.- Throws:
ClassNotFoundException
IOException
-
writeThrowable
public static void writeThrowable(File file, Throwable object) throws IOException
Writes an exception to file, even if that exception isn't serializable.- Throws:
IOException
-
-