Exemple #1
0
 public FilePage(ulong pageId, int pageSize, byte[] data)
 {
     Id    = pageId;
     _data = new byte[pageSize];
     data.CopyTo(Data, 0);
     IsDirty      = true;
     Deleted      = false;
     _modified    = 1;
     _writeOffset = (pageId - 1) * (ulong)pageSize; // TODO : could be a bit shift instead?
     _pageSize    = pageSize;
 }
        public FilePage(ulong pageId, int pageSize, byte[] data)
        {
            Id    = pageId;
            _data = new byte[pageSize];
            data.CopyTo(Data, 0);
            IsDirty      = true;
            Deleted      = false;
            _modified    = 1;
            _writeOffset = (pageId - 1) * (ulong)pageSize; // TODO : could be a bit shift instead?
            _pageSize    = pageSize;
#if DEBUG_PAGESTORE
            Logging.LogDebug("New Data: PageId={0} Hash={1}", Id, DataHash());
#endif
        }