public bool TryGet(ref Collections.Sequences.Position position, out ReadOnlyMemory <byte> item, bool advance = true) { var(data, index) = position.Get <object>(); var p = new Position(data, index); var result = _buffer.TryGet(ref p, out item); if (advance) { position = Collections.Sequences.Position.Create(p.Segment, p.Index); } return(result); }
public bool TryGet(ref SequencePosition position, out ReadOnlyMemory <byte> item, bool advance = true) => _buffer.TryGet(ref position, out item, advance);