3 writes to _chars
Microsoft.AspNetCore.WebSockets (3)
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (3)
21_chars = initialBuffer; 28_chars = _arrayToReturnToPool; 298_chars = _arrayToReturnToPool = poolArray;
40 references to _chars
Microsoft.AspNetCore.WebSockets (40)
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (40)
38Debug.Assert(value <= _chars.Length); 43public int Capacity => _chars.Length; 51if ((uint)capacity > (uint)_chars.Length) 65return ref MemoryMarshal.GetReference(_chars); 77_chars[Length] = '\0'; 79return ref MemoryMarshal.GetReference(_chars); 87return ref _chars[index]; 93string s = _chars.Slice(0, _pos).ToString(); 99public Span<char> RawChars => _chars; 110_chars[Length] = '\0'; 112return _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 116public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 117public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 121if (_chars.Slice(0, _pos).TryCopyTo(destination)) 137if (_pos > _chars.Length - count) 143_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 144_chars.Slice(index, count).Fill(value); 157if (_pos > (_chars.Length - count)) 163_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 164s.AsSpan().CopyTo(_chars.Slice(index)); 172if ((uint)pos < (uint)_chars.Length) 174_chars[pos] = c; 192if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 194_chars[pos] = s[0]; 206if (pos > _chars.Length - s.Length) 211s.AsSpan().CopyTo(_chars.Slice(pos)); 217if (_pos > _chars.Length - count) 222Span<char> dst = _chars.Slice(_pos, count); 233if (pos > _chars.Length - length) 238Span<char> dst = _chars.Slice(_pos, length); 249if (pos > _chars.Length - value.Length) 254value.CopyTo(_chars.Slice(_pos)); 262if (origPos > _chars.Length - length) 268return _chars.Slice(origPos, length); 290Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 293char[] poolArray = ArrayPool<char>.Shared.Rent((int)Math.Max((uint)(_pos + additionalCapacityBeyondPos), (uint)_chars.Length * 2)); 295_chars.Slice(0, _pos).CopyTo(poolArray);