Exemple #1
0
        /// <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);
            }
        }
Exemple #2
0
 /// <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;
     }
 }
Exemple #3
0
 private void ResetPageAddress(CachedIoAdapter.Page page, long startAddress)
 {
     page.StartAddress(startAddress);
     page.EndAddress(startAddress + _pageSize);
 }