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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Tdeserialize(File inf) Wraps the opening of a bufferedFileOutputStreamandObjectOutputStream, then thenwritesthe object in it and closes.static <T> TJust likeObjectInputStream.readObject(), with the checked exception wrapper includedstatic <T> Tdeserialize(String inpath) static voidDefaults to false (creates the file from scratch)static voidWraps the opening of a bufferedFileOutputStreamandObjectOutputStream, then thenwritesthe object in it and closes.static voidserialize(ObjectOutputStream out, Object object) Just likeObjectOutputStream.writeObject(Object), with the checked exception wrapper includedstatic voidstatic void
-
Constructor Details
-
SerializationUtils
public SerializationUtils()
-
-
Method Details
-
serialize
Just likeObjectOutputStream.writeObject(Object), with the checked exception wrapper included- Throws:
UncheckedIOExceptionNullPointerException- if the object is null
-
serialize
Wraps the opening of a bufferedFileOutputStreamandObjectOutputStream, then thenwritesthe 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 bufferedFileOutputStreamandObjectOutputStream, then thenwritesthe object in it and closes. -
deserialize
-