5 writes to _lineLength
Microsoft.Extensions.AI.OpenAI (5)
src\Shared\ServerSentEvents\SseParser_1.cs (5)
154_lineLength -= advance; 234_lineLength -= advance; 504_lineLength += bytesRead; 531_lineLength += bytesRead; 553_lineLength -= 3;
23 references to _lineLength
Microsoft.Extensions.AI.OpenAI (23)
src\Shared\ServerSentEvents\SseParser_1.cs (23)
125while (FillLineBuffer() != 0 && _lineLength < Utf8Bom.Length); 143_newlineIndex - _lineOffset + 1 < _lineLength || // we must have CR and we have whatever comes after it 163_lastSearchedForNewline = _lineOffset + _lineLength; 205while (await FillLineBufferAsync(cancellationToken).ConfigureAwait(false) != 0 && _lineLength < Utf8Bom.Length) ; 223_newlineIndex - _lineOffset + 1 < _lineLength || // newline is CR, and we have whatever comes after it 274searchLength = _lineLength - (_lastSearchedForNewline - _lineOffset); 279searchLength = _lineLength; 282Debug.Assert(searchOffset >= _lineOffset, $"{searchOffset}, {_lineLength}"); 283Debug.Assert(searchOffset <= _lineOffset + _lineLength, $"{searchOffset}, {_lineOffset}, {_lineLength}"); 287Debug.Assert(searchLength <= _lineLength, $"{searchLength}, {_lineLength}"); 292Debug.Assert(_newlineIndex - _lineOffset < _lineLength, "Expected to be positioned at a non-empty newline"); 293return _lineBuffer.AsSpan(_newlineIndex, _lineLength - (_newlineIndex - _lineOffset)).StartsWith(CRLF) ? 2 : 1; 309if (_lineOffset + _lineLength == _lineBuffer.Length) 313_lineBuffer.AsSpan(_lineOffset, _lineLength).CopyTo(_lineBuffer); 321else if (_lineLength == _lineBuffer.Length) 392ReadOnlySpan<byte> remainder = _lineBuffer.AsSpan(_newlineIndex + newlineLength, _lineLength - line.Length - newlineLength); 407if (_dataBuffer is null || _dataLength + _lineLength + 1 > _dataBuffer.Length) 409GrowBuffer(ref _dataBuffer, _dataLength + _lineLength + 1); 494int offset = _lineOffset + _lineLength; 520int offset = _lineOffset + _lineLength; 550if (_lineBuffer.AsSpan(0, _lineLength).StartsWith(Utf8Bom))