コード例 #1
0
 internal ReadableBuffer(ReadCursor start, ReadCursor end)
 {
     _start = start;
     _end   = end;
     start.TryGetBuffer(end, out _first);
     _length = -1;
 }
コード例 #2
0
 internal ReadableBuffer(ReadCursor start, ReadCursor end)
 {
     _start = start;
     _end   = end;
     if (!end.IsEnd && !end.GreaterOrEqual(start))
     {
         throw new ArgumentException("End should be greater or equal to start");
     }
     start.TryGetBuffer(end, out _first, out start);
     _length = -1;
 }
コード例 #3
0
        private ReadableBuffer(ref ReadableBuffer buffer)
        {
            var begin = buffer._start;
            var end   = buffer._end;

            BufferSegment segmentTail;
            var           segmentHead = BufferSegment.Clone(begin, end, out segmentTail);

            begin = new ReadCursor(segmentHead);
            end   = new ReadCursor(segmentTail, segmentTail.End);

            _start = begin;
            _end   = end;

            _length = buffer._length;

            begin.TryGetBuffer(end, out _first, out begin);
        }