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 Details

  • Method Details

    • writeObject

      public static void writeObject​(Object object, File destinationFile) throws IOException
      Writes an object to the destination file.
      Parameters:
      object - the object
      destinationFile - the destination file
      Throws:
      IOException - exception thrown whenever an error occurred while writing the file
    • readObject

      public static Object readObject​(File serializedFile) throws IOException, ClassNotFoundException
      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 file
      ClassNotFoundException - exception thrown whenever an unknown class is found