コード例 #1
0
        public virtual string ReadString(int bitCount)
        {
            StringBlockHandler handler = _fileReader.FindBlockHandler <StringBlockHandler>(BlockIdentifier.StringBlock);
            var stringIdentifier       = Read <uint>(bitCount);

            return(handler[stringIdentifier]);
        }
コード例 #2
0
        public AlignedRecordReader(IBinaryStorageFile fileReader, int recordSize)
        {
            _stringBlock = fileReader.FindBlockHandler <StringBlockHandler>(BlockIdentifier.StringBlock);


            _stagingBuffer = new byte[recordSize + 8];
            _byteCursor    = 0;
        }
コード例 #3
0
        public UnalignedRecordReader(IBinaryStorageFile fileReader, long recordSize)
        {
            _fileReader = fileReader;
            _recordSize = recordSize;

            // Allocating 7 extra bytes to guarantee we don't ever read out of our memory space
            _recordData = MemoryPool <byte> .Shared.Rent((int)(recordSize + 7));

            _stringBlock = _fileReader.FindSegment(SegmentIdentifier.StringBlock)?.Handler as StringBlockHandler;

            // Read exactly what we need
            fileReader.DataStream.Read(_recordData.Memory.Span.Slice(0, (int)recordSize));
        }
コード例 #4
0
        public ByteAlignedRecordReader(IBinaryStorageFile fileReader, int recordSize)
        {
            _stringBlock = fileReader.FindSegment(SegmentIdentifier.StringBlock)?.Handler as StringBlockHandler;

            _stagingBuffer = new byte[recordSize + 8]; // Allocating 8 extra bytes for packed reads to make sure we don't start reading another process's memory out of bad luck
        }
コード例 #5
0
 public AlignedSequentialRecordReader(StringBlockHandler stringBlock)
 {
     _stringBlock = stringBlock;
 }
コード例 #6
0
 public WithStringBlock(StringBlockHandler stringBlock, int recordSize) : base(recordSize)
     => _stringBlock = stringBlock;