Class JDB2Writer
java.lang.Object
com.pnfsoftware.jeb.core.dao.impl.JDB2Writer
- All Implemented Interfaces:
IFileDatabaseWriter,Closeable,AutoCloseable
JDB2 (JEB saved project database) record writer.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbeginRecord(int type, int flags) Initialize a new record.voidclose()voidendRecord(OutputStream out) Close an opened record.Retrieve the backing file, if any.booleanDetermine if this database is backed by a file.voidverify()Verify that all opened records were closed.
-
Constructor Details
-
JDB2Writer
- Throws:
IOException
-
JDB2Writer
- Throws:
IOException
-
-
Method Details
-
hasBackingFile
public boolean hasBackingFile()Description copied from interface:IFileDatabaseWriterDetermine if this database is backed by a file.- Specified by:
hasBackingFilein interfaceIFileDatabaseWriter- Returns:
-
getBackingFile
Description copied from interface:IFileDatabaseWriterRetrieve the backing file, if any.- Specified by:
getBackingFilein interfaceIFileDatabaseWriter- Returns:
-
beginRecord
Description copied from interface:IFileDatabaseWriterInitialize a new record.- Specified by:
beginRecordin interfaceIFileDatabaseWriter- Parameters:
type- the record type, should be in [0, 0xFFFFFF], refer toJDB2Manager.TYPE_xxxfor a list of well-known types; custom types are allowed and must start be in the 0x99xxxx rangeflags- record flags, should be in [0, 0xFF], seeJDB2Manager.FLAG_xxxfor a list of accepted flags- Returns:
- the output stream for the newly-created record
- Throws:
IOException
-
endRecord
Description copied from interface:IFileDatabaseWriterClose an opened record.- Specified by:
endRecordin interfaceIFileDatabaseWriter- Throws:
IOException
-
verify
public void verify()Description copied from interface:IFileDatabaseWriterVerify that all opened records were closed. To be called beforeCloseable.close()if no I/O error happened.- Specified by:
verifyin interfaceIFileDatabaseWriter
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-