protected override void ReadContent(LiteDB.ByteReader reader) { var info = reader.ReadString(HEADER_INFO.Length); var ver = reader.ReadByte(); this.ChangeID = reader.ReadUInt16(); this.FreeEmptyPageID = reader.ReadUInt32(); this.LastPageID = reader.ReadUInt32(); this.DbVersion = reader.ReadUInt16(); this.Password = reader.ReadBytes(this.Password.Length); // read page collections references (position on end of page) var cols = reader.ReadByte(); for (var i = 0; i < cols; i++) { this.CollectionPages.Add(reader.ReadString(), reader.ReadUInt32()); } }
protected override void ReadContent(LiteDB.ByteReader reader) { this.DataBlocks = new Dictionary<ushort, DataBlock>(ItemCount); for (var i = 0; i < ItemCount; i++) { var block = new DataBlock(); block.Page = this; block.Position = new LiteDB.PageAddress(this.PageID, reader.ReadUInt16()); block.ExtendPageID = reader.ReadUInt32(); for (var j = 0; j < CollectionIndex.INDEX_PER_COLLECTION; j++) { block.IndexRef[j] = reader.ReadPageAddress(); } var size = reader.ReadUInt16(); block.Data = reader.ReadBytes(size); this.DataBlocks.Add(block.Position.Index, block); } }
protected override void ReadContent(LiteDB.ByteReader reader) { this.Data = reader.ReadBytes(this.ItemCount); }