6 writes to _bytes
Microsoft.Extensions.AI.OpenAI (6)
src\Shared\ServerSentEvents\ArrayBuffer.cs (6)
44_bytes = initialSize == 0 56_bytes = buffer; 67_bytes = null!; 85_bytes = Array.Empty<byte>(); 139_bytes = ArrayPool<byte>.Shared.Rent(byteCount); 176_bytes = newBytes;
17 references to _bytes
Microsoft.Extensions.AI.OpenAI (17)
src\Shared\ServerSentEvents\ArrayBuffer.cs (17)
66byte[] array = _bytes; 79Debug.Assert(_bytes is not null); 84byte[] bufferToReturn = _bytes!; 90public readonly Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart); 91public readonly ReadOnlySpan<byte> ActiveReadOnlySpan => new ReadOnlySpan<byte>(_bytes, _activeStart, _availableStart - _activeStart); 92public readonly Memory<byte> ActiveMemory => new Memory<byte>(_bytes, _activeStart, _availableStart - _activeStart); 94public readonly int AvailableLength => _bytes.Length - _availableStart; 95public readonly Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart); 96public readonly Memory<byte> AvailableMemory => _bytes.AsMemory(_availableStart); 97public readonly Memory<byte> AvailableMemorySliced(int length) => new Memory<byte>(_bytes, _availableStart, length); 99public readonly int Capacity => _bytes.Length; 102public readonly byte[] DangerousGetUnderlyingBuffer() => _bytes; 136if (_bytes.Length == 0) 147Buffer.BlockCopy(_bytes, _activeStart, _bytes, 0, ActiveLength); 156int newSize = _bytes.Length; 166byte[] oldBytes = _bytes;