Package com.compomics.util.io.file
Class SerializationUtils
java.lang.Object
com.compomics.util.io.file.SerializationUtils
This class implements convenience methods for serialization and
deserialization.
- Author:
- Marc Vaudel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectreadObject(File serializedFile) Reads an object from a serialized file.static voidwriteObject(Object object, File destinationFile) Writes an object to the destination file.
-
Constructor Details
-
SerializationUtils
public SerializationUtils()Empty default constructor
-
-
Method Details
-
writeObject
Writes an object to the destination file.- Parameters:
object- the objectdestinationFile- the destination file- Throws:
IOException- exception thrown whenever an error occurred while writing the file
-
readObject
Reads an object from a serialized file.- Parameters:
serializedFile- the serialized file- Returns:
- the object
- Throws:
IOException- exception thrown whenever an error occurred while reading the fileClassNotFoundException- exception thrown whenever an unknown class is found
-