public DataTable(final File filePath, final PagePool pool) throws IOException { myFile = new RandomAccessDataFile(filePath, pool); if (myFile.length() == 0) { markDirty(); } else { readInHeader(filePath); } }
public AbstractRecordsTable(final File storageFilePath, final PagePool pool) throws IOException { myStorage = new RandomAccessDataFile(storageFilePath, pool); if (myStorage.length() == 0) { myStorage.put(0, new byte[getHeaderSize()], 0, getHeaderSize()); markDirty(); } else { if (myStorage.getInt(HEADER_MAGIC_OFFSET) != getSafelyClosedMagic()) { myStorage.dispose(); throw new IOException("Records table for '" + storageFilePath + "' haven't been closed correctly. Rebuild required."); } } }