public ReadableBufferReader(ReadCursor start, ReadCursor end) : this() { _end = false; _index = 0; _overallIndex = 0; _enumerator = new MemoryEnumerator(start, end); _currentMemory = default(Span <byte>); while (_enumerator.MoveNext()) { if (!_enumerator.Current.IsEmpty) { _currentMemory = _enumerator.Current.Span; return; } } _end = true; }
public ReadableBufferReader(ReadableBuffer buffer) { _end = false; _index = 0; _overallIndex = 0; _enumerator = buffer.GetEnumerator(); _currentMemory = default(Span <byte>); while (_enumerator.MoveNext()) { if (!_enumerator.Current.IsEmpty) { _currentMemory = _enumerator.Current.Span; return; } } _end = true; }