コード例 #1
0
        public BTPage(bool unicode, byte[] pageData, BREF _ref, PSTFile pst)
        {
            InternalChildren = new List <BTPage>();
            this._ref        = _ref;
            if (unicode)
            {
                _trailer    = new PageTrailer(unicode, pageData.RangeSubset(496, 16));
                _numEntries = pageData[488];
                _maxEntries = pageData[489];
                _cbEnt      = pageData[490];
                _cLevel     = pageData[491];
            }
            else
            {
                _trailer    = new PageTrailer(unicode, pageData.RangeSubset(500, 12));
                _numEntries = pageData[496];
                _maxEntries = pageData[497];
                _cbEnt      = pageData[498];
                _cLevel     = pageData[499];
            }

            Entries = new List <BTPAGEENTRY>();
            for (var i = 0; i < _numEntries; i++)
            {
                var curEntryBytes = pageData.RangeSubset(i * _cbEnt, _cbEnt);
                if (_cLevel == 0)
                {
                    if (_trailer.PageType == PageType.NBT)
                    {
                        Entries.Add(new NBTENTRY(unicode, curEntryBytes));
                    }
                    else
                    {
                        Entries.Add(new BBTENTRY(unicode, curEntryBytes));
                    }
                }
                else
                {
                    //btentries
                    var entry = new BTENTRY(unicode, curEntryBytes);
                    Entries.Add(entry);
                    using (var view = pst.PSTMMF.CreateViewAccessor((long)entry.BREF.IB, 512))
                    {
                        var bytes = new byte[512];
                        view.ReadArray(0, bytes, 0, 512);
                        InternalChildren.Add(new BTPage(unicode, bytes, entry.BREF, pst));
                    }
                }
            }
        }
コード例 #2
0
        public BTPage(byte[] pageData, BREF _ref, PSTFile pst)
        {
            this._ref             = _ref;
            this.InternalChildren = new List <BTPage>();
            this._trailer         = new PageTrailer(pageData.RangeSubset(496, 16));
            this._numEntries      = pageData[488];
            this._maxEntries      = pageData[489];
            this._cbEnt           = pageData[490];
            this._cLevel          = pageData[491];

            this.Entries = new List <BTPAGEENTRY>();
            for (var i = 0; i < this._numEntries; i++)
            {
                var curEntryBytes = pageData.RangeSubset(i * this._cbEnt, this._cbEnt);
                if (this._cLevel == 0)
                {
                    if (this._trailer.PageType == PageType.NBT)
                    {
                        this.Entries.Add(new NBTENTRY(curEntryBytes));
                    }
                    else
                    {
                        var curEntry = new BBTENTRY(curEntryBytes);
                        this.Entries.Add(curEntry);
                    }
                }
                else
                {
                    //btentries
                    var entry = new BTENTRY(curEntryBytes);
                    this.Entries.Add(entry);
                    using (var view = pst.PSTMMF.CreateViewAccessor((long)entry.BREF.IB, 512))
                    {
                        var bytes = new byte[512];
                        view.ReadArray(0, bytes, 0, 512);
                        this.InternalChildren.Add(new BTPage(bytes, entry.BREF, pst));
                    }
                }
            }
        }
コード例 #3
0
ファイル: BTPage.cs プロジェクト: Sicos1977/PST-Parser
        public BTPage(byte[] pageData, BREF _ref, PSTFile pst)
        {
            this._ref = _ref;
            this.InternalChildren = new List<BTPage>();
            this._trailer = new PageTrailer(pageData.RangeSubset(496,16));
            this._numEntries = pageData[488];
            this._maxEntries = pageData[489];
            this._cbEnt = pageData[490];
            this._cLevel = pageData[491];

            this.Entries = new List<BTPAGEENTRY>();
            for (var i = 0; i < this._numEntries; i++)
            {
                var curEntryBytes = pageData.RangeSubset(i*this._cbEnt, this._cbEnt);
                if (this._cLevel == 0)
                {
                    if (this._trailer.PageType == PageType.NBT)
                        this.Entries.Add(new NBTENTRY(curEntryBytes));
                    else
                    {
                        var curEntry = new BBTENTRY(curEntryBytes);
                        this.Entries.Add(curEntry);
                    }
                }
                else
                {
                    //btentries
                    var entry = new BTENTRY(curEntryBytes);
                    this.Entries.Add(entry);
                    using (var view = pst.PSTMMF.CreateViewAccessor((long)entry.BREF.IB,512))
                    {
                        var bytes = new byte[512];
                        view.ReadArray(0, bytes, 0, 512);
                        this.InternalChildren.Add(new BTPage(bytes, entry.BREF, pst));
                    }
                }
            }
        }