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.void
close()
void
endRecord
(OutputStream out) Close an opened record.Retrieve the backing file, if any.boolean
Determine if this database is backed by a file.void
verify()
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:IFileDatabaseWriter
Determine if this database is backed by a file.- Specified by:
hasBackingFile
in interfaceIFileDatabaseWriter
- Returns:
-
getBackingFile
Description copied from interface:IFileDatabaseWriter
Retrieve the backing file, if any.- Specified by:
getBackingFile
in interfaceIFileDatabaseWriter
- Returns:
-
beginRecord
Description copied from interface:IFileDatabaseWriter
Initialize a new record.- Specified by:
beginRecord
in interfaceIFileDatabaseWriter
- Parameters:
type
- the record type, should be in [0, 0xFFFFFF], refer toJDB2Manager.TYPE_xxx
for 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_xxx
for a list of accepted flags- Returns:
- the output stream for the newly-created record
- Throws:
IOException
-
endRecord
Description copied from interface:IFileDatabaseWriter
Close an opened record.- Specified by:
endRecord
in interfaceIFileDatabaseWriter
- Throws:
IOException
-
verify
public void verify()Description copied from interface:IFileDatabaseWriter
Verify that all opened records were closed. To be called beforeCloseable.close()
if no I/O error happened.- Specified by:
verify
in interfaceIFileDatabaseWriter
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-