private IEnumerable <IMappedBlock> CreateMappedBlocks() { // Create an area for the index block pointer var indexBlockArea = indexSetStore.Store.GetArea(StartOffset); // First create the list of block entries for this list var blocks = new IMappedBlock[(int)blockEntries]; if (blockEntries != 0) { indexBlockArea.Position = 16; for (int i = 0; i < blockEntries; ++i) { // NOTE: We cast to 'int' here because of internal limitations. var firstEntry = indexBlockArea.ReadInt8(); var lastEntry = indexBlockArea.ReadInt8(); var blockPointer = indexBlockArea.ReadInt8(); var typeSize = indexBlockArea.ReadInt4(); //TODO: check this... // size is the first 24 bits (max size = 16MB) int elementCount = typeSize & 0x0FFF; byte type = (byte)(BytesUtil.URShift(typeSize, 24) & 0x0F); blocks[i] = StoreIndex.NewMappedBlock(indexSetStore, firstEntry, lastEntry, blockPointer, elementCount, type, BlockSize); } } return(blocks); }
public MappedBlock(StoreIndex index) : base(index.MaxBlockSize) { IndexSetStore = index.IndexSetStore; maxBlockSize = index.MaxBlockSize; BlockPointer = -1; }