3 writes to _buffer
Microsoft.AspNetCore.OutputCaching (3)
RecyclableArrayBufferWriter.cs (3)
28
_buffer
= Array.Empty<T>();
36
_buffer
= Array.Empty<T>();
119
_buffer
= ArrayPool<T>.Shared.Rent(newSize);
12 references to _buffer
Microsoft.AspNetCore.OutputCaching (12)
RecyclableArrayBufferWriter.cs (12)
24
public int FreeCapacity =>
_buffer
.Length - _index;
34
var tmp =
_buffer
;
50
if (_index >
_buffer
.Length - count)
61
public ReadOnlyMemory<T> GetCommittedMemory() => new ReadOnlyMemory<T>(
_buffer
, 0, _index); // could also directly expose a ReadOnlySpan<byte> if useful
66
Debug.Assert(
_buffer
.Length > _index);
67
return
_buffer
.AsMemory(_index);
73
Debug.Assert(
_buffer
.Length > _index);
74
return
_buffer
.AsSpan(_index);
78
public T[] ToArray() =>
_buffer
.AsSpan(0, _index).ToArray();
91
int currentLength =
_buffer
.Length;
118
var oldArray =
_buffer
;
120
oldArray.AsSpan(0, _index).CopyTo(
_buffer
);