Пример #1
0
        public PositionRange ReadRange(byte delimiter)
        {
            var range = new PositionRange();

            range.From = Position;
            range.To   = AdvanceToDelimiter(delimiter);
            return(range);
        }
Пример #2
0
        PositionRange ReadRange(ReadOnlySpan <byte> delimiter)
        {
            var range = new PositionRange(Position, PositionOf(delimiter));

            if (!range.End.IsEnd)
            {
                Advance(range.End);
                Advance(delimiter.Length);
            }
            return(range);
        }
Пример #3
0
        PositionRange ReadRange(ReadOnlySpan <byte> delimiter)
        {
            var range = new PositionRange(Position, PositionOf(delimiter).GetValueOrDefault());

            if (range.End != default)
            {
                Advance(range.End);
                Advance(delimiter.Length);
            }
            return(range);
        }
Пример #4
0
        public PositionRange ReadRange(ReadOnlySpan <byte> delimiter)
        {
            var range = new PositionRange();

            range.From = Position;
            range.To   = PositionOf(delimiter);
            if (!range.To.IsEnd)
            {
                Advance(range.To);
                Advance(delimiter.Length);
            }
            return(range);
        }