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)
66
byte[] array =
_bytes
;
79
Debug.Assert(
_bytes
is not null);
84
byte[] bufferToReturn =
_bytes
!;
90
public readonly Span<byte> ActiveSpan => new Span<byte>(
_bytes
, _activeStart, _availableStart - _activeStart);
91
public readonly ReadOnlySpan<byte> ActiveReadOnlySpan => new ReadOnlySpan<byte>(
_bytes
, _activeStart, _availableStart - _activeStart);
92
public readonly Memory<byte> ActiveMemory => new Memory<byte>(
_bytes
, _activeStart, _availableStart - _activeStart);
94
public readonly int AvailableLength =>
_bytes
.Length - _availableStart;
95
public readonly Span<byte> AvailableSpan =>
_bytes
.AsSpan(_availableStart);
96
public readonly Memory<byte> AvailableMemory =>
_bytes
.AsMemory(_availableStart);
97
public readonly Memory<byte> AvailableMemorySliced(int length) => new Memory<byte>(
_bytes
, _availableStart, length);
99
public readonly int Capacity =>
_bytes
.Length;
102
public readonly byte[] DangerousGetUnderlyingBuffer() =>
_bytes
;
136
if (
_bytes
.Length == 0)
147
Buffer.BlockCopy(
_bytes
, _activeStart,
_bytes
, 0, ActiveLength);
156
int newSize =
_bytes
.Length;
166
byte[] oldBytes =
_bytes
;