|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
SerializedType
- The type of object that can be serialized.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.
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 |
---|
void writeToFile(String fileName, SerializedType object) throws IOException
fileName
- The name of the file to write the object to.object
- The object to write.
IOException
- If there is an i/o error.void writeToFile(File file, SerializedType object) throws IOException
file
- The file to write the object to.object
- The object to write.
IOException
- If there is an i/o error.Object readFromFile(String fileName) throws IOException, ClassNotFoundException
fileName
- The name of the file to read an object from.
IOException
- If there is an i/o error.
ClassNotFoundException
- If a class cannot be found.Object readFromFile(File file) throws IOException, ClassNotFoundException
file
- The file to read an object from.
IOException
- If there is an i/o error.
ClassNotFoundException
- If a class cannot be found.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |