/** * @return The index of the first byte contained in this database as a function of the index of * the first record */ protected final long firstByteIndex() { return myLogic.getByteIndex(firstRecordIndex); }
public void writeRecord(DatabaseHandle dh, long recordIndex, long record) throws IOException { writeRecordFromByteIndex(dh, myLogic.getByteIndex(recordIndex), record); }
public void prepareWriteRecordRange(DatabaseHandle dh, long recordIndex, long numRecords) throws IOException { prepareWriteRange(dh, myLogic.getByteIndex(recordIndex), myLogic.getNumBytes(numRecords)); }
/** * Reads a record at the given hash * * @param dh The handle to use for reading * @param recordIndex The hash of the game state where the record should be read * @return The hash of the record read at that position * @throws IOException If an IOException occurs while reading */ public long readRecord(DatabaseHandle dh, long recordIndex) throws IOException { return readRecordFromByteIndex(dh, myLogic.getByteIndex(recordIndex)); }