public interface PCDIO
PCD I/O Canvas.
This interface is used to designate that a canvas may provide I/O for a PCD menu command. The two types of I/O provided by the canvas are reading files (which are specified by the PCD menu command), or writing the contents of the canvas to a file (also specified by the PCD menu command). In either case a reader or writer object is passed instead of a filename. This allows future feature additions, such as using the 'readFile' and 'writeFile' methods to perform I/O operations on streams instead of files.
Modifier and Type | Method and Description |
---|---|
void |
readFile(java.lang.String format,
java.io.Reader in,
boolean overwrite,
boolean forceall)
Reads data into the canvas.
|
void |
writeFile(java.lang.String format,
java.lang.Appendable out,
boolean forceall)
Writes data out from the canvas.
|
void readFile(java.lang.String format, java.io.Reader in, boolean overwrite, boolean forceall) throws java.io.IOException
format
- the file format to use for parsing the file. If the
string "" is passed, the PCDIO object should auto-
detect the format of the data.in
- the "file" (or stream) to read in from.overwrite
- whether to overwrite the currently selected
data in the current canvas with the data
being imported by this function/method.java.io.IOException
- if an error occurs while readingvoid writeFile(java.lang.String format, java.lang.Appendable out, boolean forceall) throws java.io.IOException
format
- the file format to use for writing the file.out
- the "file" (or stream) to write out to.forceall
- write the entire contents of the canvas
instead of just the currently selected
sequences in the canvas.java.io.IOException
- if an error occurs while writingCopyright © 2008-2022 University of Manitoba.