3 writes to _lineBuffer
System.Net.ServerSentEvents (3)
System\Net\ServerSentEvents\SseParser_1.cs (3)
104
_lineBuffer
= ArrayPool<byte>.Shared.Rent(DefaultArrayPoolRentSize);
184
_lineBuffer
= ArrayPool<byte>.Shared.Rent(DefaultArrayPoolRentSize);
306
GrowBuffer(ref
_lineBuffer
, _lineBuffer.Length * 2);
23 references to _lineBuffer
System.Net.ServerSentEvents (23)
System\Net\ServerSentEvents\SseParser_1.cs (23)
53
/// <summary>The starting offset of valid data in <see cref="
_lineBuffer
"/>.</summary>
55
/// <summary>The length of valid data in <see cref="
_lineBuffer
"/>, starting from <see cref="_lineOffset"/>.</summary>
57
/// <summary>The index in <see cref="
_lineBuffer
"/> where a newline ('\r', '\n', or "\r\n") was found.</summary>
59
/// <summary>The index in <see cref="
_lineBuffer
"/> of characters already checked for newlines.</summary>
121
_newlineIndex =
_lineBuffer
.AsSpan(searchOffset, searchLength).IndexOfAny(CR, LF);
126
if (
_lineBuffer
[_newlineIndex] is LF || // the newline is LF
164
ArrayPool<byte>.Shared.Return(
_lineBuffer
);
201
_newlineIndex =
_lineBuffer
.AsSpan(searchOffset, searchLength).IndexOfAny(CR, LF);
206
if (
_lineBuffer
[_newlineIndex] is LF || // newline is LF
244
ArrayPool<byte>.Shared.Return(
_lineBuffer
);
268
Debug.Assert(searchOffset <=
_lineBuffer
.Length, $"{searchOffset}, {
_lineBuffer
.Length}");
277
return
_lineBuffer
.AsSpan(_newlineIndex, _lineLength - (_newlineIndex - _lineOffset)).StartsWith(CRLF) ? 2 : 1;
293
if (_lineOffset + _lineLength ==
_lineBuffer
.Length)
297
_lineBuffer
.AsSpan(_lineOffset, _lineLength).CopyTo(
_lineBuffer
);
304
else if (_lineLength ==
_lineBuffer
.Length)
306
GrowBuffer(ref _lineBuffer,
_lineBuffer
.Length * 2);
317
ReadOnlySpan<byte> line =
_lineBuffer
.AsSpan(_lineOffset, _newlineIndex - _lineOffset);
375
ReadOnlySpan<byte> remainder =
_lineBuffer
.AsSpan(_newlineIndex + newlineLength, _lineLength - line.Length - newlineLength);
479
_lineBuffer
.AsSpan(offset));
505
_stream.ReadAsync(
_lineBuffer
.AsMemory(offset), cancellationToken)
532
if (
_lineBuffer
.AsSpan(0, _lineLength).StartsWith(Utf8Bom))