3 writes to _currentSegment
Microsoft.AspNetCore.SignalR.StackExchangeRedis (3)
src\SignalR\common\Shared\MemoryBufferWriter.cs (3)
96
_currentSegment
= null;
187
_currentSegment
= ArrayPool<byte>.Shared.Rent(Math.Max(_minimumSegmentSize, sizeHint));
340
_currentSegment
= null;
31 references to _currentSegment
Microsoft.AspNetCore.SignalR.StackExchangeRedis (31)
src\SignalR\common\Shared\MemoryBufferWriter.cs (31)
93
if (
_currentSegment
!= null)
95
ArrayPool<byte>.Shared.Return(
_currentSegment
);
113
return
_currentSegment
.AsMemory(_position,
_currentSegment
.Length - _position);
120
return
_currentSegment
.AsSpan(_position,
_currentSegment
.Length - _position);
135
destination.Write(
_currentSegment
.AsSpan(0, _position));
140
if (_completedSegments == null &&
_currentSegment
is not null)
143
return destination.WriteAsync(
_currentSegment
, 0, _position, cancellationToken);
149
[MemberNotNull(nameof(
_currentSegment
))]
154
var remainingSize =
_currentSegment
?.Length - _position ?? 0;
169
[MemberNotNull(nameof(
_currentSegment
))]
172
if (
_currentSegment
!= null)
183
_completedSegments.Add(new CompletedBuffer(
_currentSegment
, _position));
208
if (
_currentSegment
is not null)
211
await destination.WriteAsync(
_currentSegment
.AsMemory(0, _position), cancellationToken).ConfigureAwait(false);
220
if (
_currentSegment
== null)
242
_currentSegment
.AsSpan(0, _position).CopyTo(result.AsSpan(totalWritten));
251
if (
_currentSegment
== null)
271
_currentSegment
.AsSpan(0, _position).CopyTo(span.Slice(totalWritten));
284
if (
_currentSegment
!= null && (uint)_position < (uint)
_currentSegment
.Length)
286
_currentSegment
[_position] = value;
291
_currentSegment
[0] = value;
301
if (
_currentSegment
!= null && position <
_currentSegment
.Length - count)
303
Buffer.BlockCopy(buffer, offset,
_currentSegment
, position, count);
317
if (
_currentSegment
!= null && span.TryCopyTo(
_currentSegment
.AsSpan(_position)))
333
if (
_currentSegment
is not null)
335
_completedSegments.Add(new CompletedBuffer(
_currentSegment
, _position));