Package com.compomics.util.io.file
Class SerializationUtils
java.lang.Object
com.compomics.util.io.file.SerializationUtils
public class SerializationUtils extends Object
This class implements convenience methods for serialization and
deserialization.
- Author:
- Marc Vaudel
-
Constructor Summary
Constructors Constructor Description SerializationUtils()
Empty default constructor -
Method Summary
Modifier and Type Method Description static Object
readObject(File serializedFile)
Reads an object from a serialized file.static void
writeObject(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
-