Package com.pnfsoftware.jeb.core.dao
Interface IFileDatabaseWriter
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
JDB2Writer
A database record writer.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbeginRecord
(int type, int flags) Initialize a new record.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.
-
Method Details
-
hasBackingFile
boolean hasBackingFile()Determine if this database is backed by a file.- Returns:
-
getBackingFile
Retrieve the backing file, if any.- Returns:
- Throws:
NoSuchFileException
-
beginRecord
Initialize a new record.- 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
Close an opened record.- Parameters:
out
-- Throws:
IOException
-
verify
void verify()Verify that all opened records were closed. To be called beforeCloseable.close()
if no I/O error happened.- Throws:
IllegalStateException
- on error
-