gov.sandia.cognition.io.serialization
Interface FileSerializationHandler<SerializedType>

Type Parameters:
SerializedType - The type of object that can be serialized.
All Known Subinterfaces:
StreamSerializationHandler<SerializedType>, TextSerializationHandler<SerializedType>
All Known Implementing Classes:
AbstractFileSerializationHandler, AbstractStreamSerializationHandler, AbstractTextSerializationHandler, GZIPSerializationHandler, JavaDefaultBinarySerializationHandler, XStreamSerializationHandler

public interface FileSerializationHandler<SerializedType>

Defines the functionality of a serialization handler that can write an object to a file and read an object from a file.

Since:
3.0
Author:
Justin Basilico
See Also:
AbstractFileSerializationHandler, StreamSerializationHandler, TextSerializationHandler

Method Summary
 Object readFromFile(File file)
          Reads an object from the given file.
 Object readFromFile(String fileName)
          Reads an object from the given file.
 void writeToFile(File file, SerializedType object)
          Reads an object from a given file.
 void writeToFile(String fileName, SerializedType object)
          Writes an object to a given file.
 

Method Detail

writeToFile

void writeToFile(String fileName,
                 SerializedType object)
                 throws IOException
Writes an object to a given file.

Parameters:
fileName - The name of the file to write the object to.
object - The object to write.
Throws:
IOException - If there is an i/o error.

writeToFile

void writeToFile(File file,
                 SerializedType object)
                 throws IOException
Reads an object from a given file.

Parameters:
file - The file to write the object to.
object - The object to write.
Throws:
IOException - If there is an i/o error.

readFromFile

Object readFromFile(String fileName)
                    throws IOException,
                           ClassNotFoundException
Reads an object from the given file.

Parameters:
fileName - The name of the file to read an object from.
Returns:
The object read from the file.
Throws:
IOException - If there is an i/o error.
ClassNotFoundException - If a class cannot be found.

readFromFile

Object readFromFile(File file)
                    throws IOException,
                           ClassNotFoundException
Reads an object from the given file.

Parameters:
file - The file to read an object from.
Returns:
The object read from the file.
Throws:
IOException - If there is an i/o error.
ClassNotFoundException - If a class cannot be found.