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)
54public readonly ReadOnlySpan<byte> Bytes => _buffer.AsSpan(_offset, _count); 70int minBufferCount = fillBuffer || _unsuccessfulReadCount > UnsuccessfulReadCountThreshold ? bufferState._buffer.Length : 0; 75bufferState._buffer.AsMemory(bufferState._count), 106_buffer.AsSpan(_count)); 119while (_count < _buffer.Length); 137if ((uint)_count > ((uint)_buffer.Length / 2)) 140byte[] oldBuffer = _buffer; 142byte[] newBuffer = ArrayPool<byte>.Shared.Rent((_buffer.Length < (int.MaxValue / 2)) ? _buffer.Length * 2 : int.MaxValue); 156Buffer.BlockCopy(_buffer, _offset + bytesConsumed, _buffer, 0, _count); 175Debug.Assert(_buffer.Length >= JsonConstants.Utf8Bom.Length); 176if (_buffer.AsSpan(0, _count).StartsWith(JsonConstants.Utf8Bom)) 187new Span<byte>(_buffer, 0, _maxCount).Clear(); 189byte[] toReturn = _buffer;