|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DataFileFormat
Interface for data persistence algorithms (general load/save filter).
BitStream| Field Summary | |
|---|---|
static java.lang.String |
DOUBLE_STREAM
Double-stream property (Boolean): file-format uses more than one bit-stream - e.g. for header and raw data. |
| Fields inherited from interface cz.cuni.jagrlib.iface.Property |
|---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
| Method Summary | |
|---|---|
void |
closeFile()
Closes the file (used in file-mapping mode). |
java.lang.String[] |
fileNameMasks()
Returns file-name masks associated with the file-format type. |
int |
headerLength()
Length of file-format header (number of bytes which is necessary for file-format matching). |
boolean |
loadFile(BitStream stream,
java.lang.Object support)
Retrieves data from the given BitStream. |
boolean |
loadFile(java.lang.String fileName,
java.lang.String detail)
Retrieves data from the given file (stream). |
double |
match(byte[] header,
java.lang.String fileName)
File-format match test. |
boolean |
saveFile(BitStream stream,
java.lang.Object support)
Saves data to the given BitStream. |
boolean |
saveFile(java.lang.String fileName,
java.lang.String detail)
Saves data to the given file (stream). |
| Methods inherited from interface cz.cuni.jagrlib.iface.Property |
|---|
commit, get, set |
| Methods inherited from interface cz.cuni.jagrlib.Breakable |
|---|
setProgressListener, stop |
| Field Detail |
|---|
static final java.lang.String DOUBLE_STREAM
loadFile(BitStream,Object),
saveFile(BitStream,Object),
Constant Field Values| Method Detail |
|---|
int headerLength()
match(byte[], java.lang.String)
double match(byte[] header,
java.lang.String fileName)
header - Bytes from beginning of the file.fileName - Optional file-name string.
0.0 .. no way,
0.5 .. maybe, 0.9 .. almost sure, 1.0 ..
absolutely - no need to check another formats).headerLength(),
fileNameMasks()java.lang.String[] fileNameMasks()
null.match(byte[], java.lang.String)
boolean loadFile(java.lang.String fileName,
java.lang.String detail)
throws java.io.IOException
fileName - File-name (stream-name) to read from (can be null).detail - Further implementation-specific information ("r" or "rw" for mapped mode).
true if the operation was successful.
java.io.IOExceptionloadFile(BitStream,Object),
saveFile(String,String),
closeFile()
boolean loadFile(BitStream stream,
java.lang.Object support)
throws java.io.IOException
BitStream. This metod is optional.
The stream should be opened before - only the BitStream.reOpen(boolean, java.lang.String) call
can be used.
stream - Input bit-stream (opened - call BitStream.reOpen(boolean, java.lang.String) first).support - Implementation-specific data (e.g. second BitStream for
file-formats with DOUBLE_STREAM property).
true if the operation was successful.
java.io.IOExceptionloadFile(String,String),
DOUBLE_STREAM
boolean saveFile(java.lang.String fileName,
java.lang.String detail)
throws java.io.IOException
fileName - File-name (stream-name) to write to (can be null).detail - Further implementation-specific information.
true if the operation was successful.
java.io.IOExceptionsaveFile(BitStream,Object),
loadFile(String,String)
boolean saveFile(BitStream stream,
java.lang.Object support)
throws java.io.IOException
BitStream. This metod is optional.
The stream should be opened and empty - the reOpen(true,null) call
is not required.
stream - Output bit-stream (opened and empty).support - Implementation-specific data (e.g. second BitStream for
file-formats with DOUBLE_STREAM property).
true if the operation was successful.
java.io.IOExceptionsaveFile(String,String),
DOUBLE_STREAM
void closeFile()
throws java.io.IOException
java.io.IOExceptionloadFile(String,String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||