3 writes to _buffer
System.Text.Json (3)
System\Text\Json\Serialization\ReadBufferState.cs (3)
46
_buffer
= ArrayPool<byte>.Shared.Rent(Math.Max(initialBufferSize, JsonConstants.Utf8Bom.Length));
146
_buffer
= newBuffer;
190
_buffer
= null!;
15 references to _buffer
System.Text.Json (15)
System\Text\Json\Serialization\ReadBufferState.cs (15)
54
public readonly ReadOnlySpan<byte> Bytes =>
_buffer
.AsSpan(_offset, _count);
70
int minBufferCount = fillBuffer || _unsuccessfulReadCount > UnsuccessfulReadCountThreshold ? bufferState.
_buffer
.Length : 0;
75
bufferState.
_buffer
.AsMemory(bufferState._count),
106
_buffer
.AsSpan(_count));
119
while (_count <
_buffer
.Length);
137
if ((uint)_count > ((uint)
_buffer
.Length / 2))
140
byte[] oldBuffer =
_buffer
;
142
byte[] newBuffer = ArrayPool<byte>.Shared.Rent((
_buffer
.Length < (int.MaxValue / 2)) ?
_buffer
.Length * 2 : int.MaxValue);
156
Buffer.BlockCopy(
_buffer
, _offset + bytesConsumed,
_buffer
, 0, _count);
175
Debug.Assert(
_buffer
.Length >= JsonConstants.Utf8Bom.Length);
176
if (
_buffer
.AsSpan(0, _count).StartsWith(JsonConstants.Utf8Bom))
187
new Span<byte>(
_buffer
, 0, _maxCount).Clear();
189
byte[] toReturn =
_buffer
;