3 writes to _readBuffer
System.Net.Http (3)
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (3)
87
_readBuffer
= new ArrayBuffer(InitialReadBufferSize, usePool: false);
1974
_readBuffer
= new ArrayBuffer(pooledBuffer);
1992
_readBuffer
= new ArrayBuffer(origReadBuffer);
66 references to _readBuffer
System.Net.Http (66)
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (66)
169
_readAheadTask = _stream.ReadAsync(
_readBuffer
.AvailableMemory);
247
Debug.Assert(
_readBuffer
.ActiveLength == 0);
258
int read = await _stream.ReadAsync(
_readBuffer
.AvailableMemory).ConfigureAwait(false);
299
private int ReadBufferSize =>
_readBuffer
.Capacity;
301
private ReadOnlyMemory<byte> RemainingBuffer =>
_readBuffer
.ActiveMemory;
305
Debug.Assert(bytesToConsume <=
_readBuffer
.ActiveLength);
306
_readBuffer
.Discard(bytesToConsume);
535
Debug.Assert(
_readBuffer
.ActiveLength == 0, "Unexpected data in read buffer");
601
Debug.Assert(
_readBuffer
.ActiveLength == 0);
636
_readBuffer
.Commit(bytesRead);
648
if (
_readBuffer
.ActiveLength == 0)
1029
Span<byte> buffer =
_readBuffer
.ActiveSpan;
1035
_readBuffer
.Discard(bytesConsumed);
1131
Span<byte> buffer =
_readBuffer
.ActiveSpan;
1141
_readBuffer
.Discard(bytesConsumed);
1589
ReadOnlySpan<byte> buffer =
_readBuffer
.ActiveReadOnlySpan;
1605
_readBuffer
.Discard(bytesConsumed);
1625
Debug.Assert(
_readBuffer
.AvailableLength ==
_readBuffer
.Capacity);
1626
Debug.Assert(
_readBuffer
.AvailableLength >= InitialReadBufferSize);
1629
await _stream.ReadAsync(
_readBuffer
.AvailableMemory).ConfigureAwait(false) :
1630
_stream.Read(
_readBuffer
.AvailableSpan);
1632
_readBuffer
.Commit(bytesRead);
1642
_readBuffer
.EnsureAvailableSpace(1);
1645
await _stream.ReadAsync(
_readBuffer
.AvailableMemory).ConfigureAwait(false) :
1646
_stream.Read(
_readBuffer
.AvailableSpan);
1648
_readBuffer
.Commit(bytesRead);
1661
return
_readBuffer
.ActiveStartOffset == 0
1669
int searchOffset =
_readBuffer
.ActiveLength;
1680
Debug.Assert(
_readBuffer
.ActiveStartOffset == 0);
1681
Debug.Assert(
_readBuffer
.ActiveLength > searchOffset);
1684
if (TryFindEndOfLine(
_readBuffer
.ActiveReadOnlySpan.Slice(searchOffset), out int offset))
1691
int readLength =
_readBuffer
.ActiveLength;
1694
Debug.Assert(searchOffset == readLength - 1 &&
_readBuffer
.ActiveReadOnlySpan[searchOffset] == '\n');
1746
ReadOnlySpan<byte> available =
_readBuffer
.ActiveSpan;
1750
_readBuffer
.Discard(toCopy);
1759
if (
_readBuffer
.ActiveLength > 0)
1777
if (
_readBuffer
.ActiveLength > 0)
1803
if (
_readBuffer
.ActiveLength == 0)
1813
Debug.Assert(
_readBuffer
.AvailableLength ==
_readBuffer
.Capacity);
1814
int bytesRead = _stream.Read(
_readBuffer
.AvailableSpan);
1815
_readBuffer
.Commit(bytesRead);
1831
return destination.Length >=
_readBuffer
.Capacity || destination.Length == 0 ?
1841
if (
_readBuffer
.ActiveLength == 0)
1846
Debug.Assert(
_readBuffer
.AvailableLength ==
_readBuffer
.Capacity);
1847
int bytesRead = await _stream.ReadAsync(
_readBuffer
.AvailableMemory).ConfigureAwait(false);
1848
_readBuffer
.Commit(bytesRead);
1859
Debug.Assert(count <=
_readBuffer
.ActiveLength);
1863
ReadOnlyMemory<byte> source =
_readBuffer
.ActiveMemory.Slice(0, count);
1864
_readBuffer
.Discard(count);
1881
if (
_readBuffer
.ActiveLength > 0)
1897
int remaining =
_readBuffer
.ActiveLength;
1919
int remaining =
_readBuffer
.ActiveLength;
1934
Debug.Assert(
_readBuffer
.ActiveLength == 0, "HttpConnection's buffer should have been empty.");
1951
remaining = (int)Math.Min((ulong)
_readBuffer
.ActiveLength, length);
1966
int currentCapacity =
_readBuffer
.Capacity;
1972
origReadBuffer =
_readBuffer
.DangerousGetUnderlyingBuffer();
1989
bool anyDataAvailable =
_readBuffer
.ActiveLength > 0;
1991
byte[] pooledBuffer =
_readBuffer
.DangerousGetUnderlyingBuffer();
1997
_readBuffer
.Commit(1);
2048
if (
_readBuffer
.ActiveLength > 0)
2055
_readBuffer
.Discard(
_readBuffer
.ActiveLength);
2103
Debug.Assert(
_readBuffer
.ActiveLength == 0, "Unexpected data in connection read buffer.");