Beispiel #1
0
        public HNBlock(int blockIndex, BlockDataDTO bytes)
        {
            this._bytes = bytes;

            this.PageMapOffset = BitConverter.ToUInt16(this._bytes.Data, 0);
            this.PageMap       = new HNPAGEMAP(this._bytes.Data, this.PageMapOffset);
            if (blockIndex == 0)
            {
                this.Header = new HNHDR(this._bytes.Data);
            }
            else if (blockIndex % 128 == 8)
            {
                this.BitMapPageHeader = new HNBITMAPHDR(ref this._bytes.Data);
            }
            else
            {
                this.PageHeader = new HNPAGEHDR(ref this._bytes.Data);
            }
        }
Beispiel #2
0
        public HNBlock(int blockIndex, BlockDataDTO bytes)
        {
            _bytes = bytes;
            var bytesData = _bytes.Data;

            PageMapOffset = BitConverter.ToUInt16(_bytes.Data, 0);
            PageMap       = new HNPAGEMAP(_bytes.Data, PageMapOffset);
            if (blockIndex == 0)
            {
                Header = new HNHDR(_bytes.Data);
            }
            else if (blockIndex % 128 == 8)
            {
                BitMapPageHeader = new HNBITMAPHDR(ref bytesData);
            }
            else
            {
                PageHeader = new HNPAGEHDR(ref bytesData);
            }
        }