Package uk.ac.ebi.utils.io
Class SerializationUtils
java.lang.Object
uk.ac.ebi.utils.io.SerializationUtils
Object serialisation/unserialisation utils that work with IO streams.
- Author:
- brandizi
- Date:
- 26 Aug 2020
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
deserialize
(File inf) Wraps the opening of a bufferedFileOutputStream
andObjectOutputStream
, then thenwrites
the object in it and closes.static <T> T
Just likeObjectInputStream.readObject()
, with the checked exception wrapper includedstatic <T> T
deserialize
(String inpath) static void
Defaults to false (creates the file from scratch)static void
Wraps the opening of a bufferedFileOutputStream
andObjectOutputStream
, then thenwrites
the object in it and closes.static void
serialize
(ObjectOutputStream out, Object object) Just likeObjectOutputStream.writeObject(Object)
, with the checked exception wrapper includedstatic void
static void
-
Constructor Details
-
SerializationUtils
public SerializationUtils()
-
-
Method Details
-
serialize
Just likeObjectOutputStream.writeObject(Object)
, with the checked exception wrapper included- Throws:
UncheckedIOException
NullPointerException
- if the object is null
-
serialize
Wraps the opening of a bufferedFileOutputStream
andObjectOutputStream
, then thenwrites
the object in it and closes. -
serialize
Defaults to false (creates the file from scratch) -
serialize
-
serialize
-
deserialize
Just likeObjectInputStream.readObject()
, with the checked exception wrapper included- Throws:
UncheckedIOException
-
deserialize
Wraps the opening of a bufferedFileOutputStream
andObjectOutputStream
, then thenwrites
the object in it and closes. -
deserialize
-