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