public void MemoryEnumerator() { for (int i = 0; i < InnerLoopCount; i++) { var enumerator = new MemoryEnumerator(_readableBuffer.Start, _readableBuffer.End); while (enumerator.MoveNext()) { var memory = enumerator.Current; } } }
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; }