GSF.IO.FileStructure.IndexParser.GetBlockIndexValue C# (CSharp) Method

GetBlockIndexValue() private method

This uses the (blockIndex,offset) values to determine what the next block index is. This also has consistency checks to determine if the file is inconsistent (potentially corruption)
private GetBlockIndexValue ( uint blockIndex, int offset, BlockType blockType, uint blockBaseIndex ) : uint
blockIndex uint the index of the block to read
offset int the offset inside the block to use to determine the next index block
blockType BlockType the value 1-4 which tell what indirect block this is
blockBaseIndex uint the lowest virtual address that can be referenced from this indirect block
return uint
        private uint GetBlockIndexValue(uint blockIndex, int offset, BlockType blockType, uint blockBaseIndex)
        {
            DiskIoSession buffer = m_ioSessions.SourceIndex;
            if (blockIndex == 0)
                return 0;

            //Skip the redundant read if this block is still cached.
            if (!buffer.IsValid || buffer.BlockIndex != blockIndex)
            {
                buffer.Read(blockIndex, blockType, blockBaseIndex);
            }
            return *(uint*)(buffer.Pointer + (offset << 2));
        }