/// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception> private void GetPageFromDisk(CachedIoAdapter.Page page, long pos) { long startAddress = pos - pos % _pageSize; page.StartAddress(startAddress); IoSeek(page._startAddress); int count = IoRead(page); if (count > 0) { page.EndAddress(startAddress + count); } else { page.EndAddress(startAddress); } }
/// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception> private void WritePageToDisk(CachedIoAdapter.Page page) { ValidateReadOnly(); try { _io.Write(page._buffer, page.Size()); _filePointer = page.EndAddress(); page._dirty = false; } catch (Db4oIOException e) { _readOnly = true; throw; } }
private void ResetPageAddress(CachedIoAdapter.Page page, long startAddress) { page.StartAddress(startAddress); page.EndAddress(startAddress + _pageSize); }