Interface IFileDatabaseWriter

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
JDB2Writer

public interface IFileDatabaseWriter extends Closeable
A database record writer.
See Also:
  • Method Details

    • hasBackingFile

      boolean hasBackingFile()
      Determine if this database is backed by a file.
      Returns:
    • getBackingFile

      File getBackingFile() throws NoSuchFileException
      Retrieve the backing file, if any.
      Returns:
      Throws:
      NoSuchFileException
    • beginRecord

      OutputStream beginRecord(int type, int flags) throws IOException
      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
    • endRecord

      void endRecord(OutputStream out) throws IOException
      Close an opened record.
      Parameters:
      out -
      Throws:
      IOException
    • verify

      void verify()
      Verify that all opened records were closed. To be called before Closeable.close() if no I/O error happened.
      Throws:
      IllegalStateException - on error