public interface

IFileDatabaseWriter

implements Closeable
com.pnfsoftware.jeb.core.dao.IFileDatabaseWriter
Known Indirect Subclasses

Class Overview

A database record writer.

See Also

Summary

Public Methods
abstract OutputStream beginRecord(int type, int flags)
Initialize a new record.
abstract void endRecord(OutputStream out)
Close an opened record.
abstract File getBackingFile()
Retrieve the backing file, if any.@return
abstract boolean hasBackingFile()
Determine if this database is backed by a file.
abstract void verify()
Verify that all opened records were closed.
[Expand]
Inherited Methods
From interface java.io.Closeable
From interface java.lang.AutoCloseable

Public Methods

public abstract OutputStream beginRecord (int type, int flags)

Initialize a new record.

Parameters
type the record type, should be in [0, 0xFFFFFF], refer to JDB2Manager.TYPE_xxx for a list of well-known types; custom types are allowed and must start be in the 0x99xxxx range
flags record flags, should be in [0, 0xFF], see JDB2Manager.FLAG_xxx for a list of accepted flags
Returns
  • the output stream for the newly-created record
Throws
IOException

public abstract void endRecord (OutputStream out)

Close an opened record.

Throws
IOException

public abstract File getBackingFile ()

Retrieve the backing file, if any.@return

Throws
NoSuchFileException

public abstract boolean hasBackingFile ()

Determine if this database is backed by a file.

public abstract void verify ()

Verify that all opened records were closed. To be called before close() if no I/O error happened.

Throws
IllegalStateException on error