コード例 #1
0
ファイル: ReadSession.cs プロジェクト: ksec/resin
        public ReadSession(
            BatchInfo version,
            PostingsReader postingsReader,
            DocHashReader docHashReader,
            DocumentAddressReader addressReader,
            Stream stream)
        {
            Version = version;

            _stream         = stream;
            _docHashReader  = docHashReader;
            _postingsReader = postingsReader;
            _addressReader  = addressReader;
            _blockSize      = BlockSerializer.SizeOfBlock();
        }
コード例 #2
0
        public DtblStream(Stream stream, BatchInfo ix, int skip = 0, int take = int.MaxValue)
            : base(ix.PrimaryKeyFieldName)
        {
            _dataFile = stream;
            _ix       = ix;
            _dataFile.Seek(_ix.KeyIndexOffset, SeekOrigin.Begin);
            var keyIndex = TableSerializer.ReadKeyIndex(_dataFile, _ix.KeyIndexSize);

            _hashReader     = new DocHashReader(_dataFile, _ix.DocHashOffset, leaveOpen: false);
            _addressReader  = new DocumentAddressReader(_dataFile, _ix.DocAddressesOffset);
            _documentReader = new DocumentReader(_dataFile, _ix.Compression, keyIndex, leaveOpen: false);

            _skip = skip;
            _take = take;
        }