1 write to _buffer
System.IO.Compression (1)
System\IO\Compression\Zstandard\ZstandardStream.cs (1)
53_buffer = new ArrayBuffer(DefaultInternalBufferSize, usePool: true);
34 references to _buffer
System.IO.Compression (34)
System\IO\Compression\Zstandard\ZstandardStream.Compress.cs (4)
44_buffer.Dispose(); 69_buffer.Dispose(); 134Span<byte> output = _buffer.AvailableSpan; 195Memory<byte> output = _buffer.AvailableMemory;
System\IO\Compression\Zstandard\ZstandardStream.cs (4)
27[MemberNotNull(nameof(_buffer))] 81_buffer.Dispose(); 121_buffer.Dispose(); 244_buffer.Dispose();
System\IO\Compression\Zstandard\ZstandardStream.Decompress.cs (26)
59_buffer.Dispose(); 73OperationStatus status = _decoder.Decompress(_buffer.ActiveSpan, destination, out int bytesConsumed, out bytesWritten); 74_buffer.Discard(bytesConsumed); 106if (_buffer.ActiveLength != 0) 114(status == OperationStatus.DestinationTooSmall && destination.IsEmpty && _buffer.ActiveLength == 0), $"{nameof(status)} == {status}, {nameof(destination.Length)} == {destination.Length}"); 170_buffer.EnsureAvailableSpace(1); 172int bytesRead = _stream.Read(_buffer.AvailableSpan); 188if (bytesRead > _buffer.AvailableLength) 193_buffer.Commit(bytesRead); 231if (_buffer.ActiveLength < ZstdFrameMagicLength) 238int needed = ZstdFrameMagicLength - _buffer.ActiveLength; 239_buffer.EnsureAvailableSpace(needed); 241? await _stream.ReadAtLeastAsync(_buffer.AvailableMemory.Slice(0, needed), needed, throwOnEndOfStream: false, cancellationToken: cancellationToken).ConfigureAwait(false) 242: _stream.ReadAtLeast(_buffer.AvailableSpan.Slice(0, needed), needed, throwOnEndOfStream: false); 246_buffer.Commit(peeked); 250if (_buffer.ActiveLength >= ZstdFrameMagicLength) 265_buffer.EnsureAvailableSpace(1); 266if (_decoder.Decompress(_buffer.ActiveSpan.Slice(0, ZstdFrameMagicLength), _buffer.AvailableSpan.Slice(0, 1), out int bytesConsumed, out _) == OperationStatus.NeedMoreData) 270_buffer.Discard(bytesConsumed); 344_buffer.EnsureAvailableSpace(1); 346int bytesRead = await _stream.ReadAsync(_buffer.AvailableMemory, cancellationToken).ConfigureAwait(false); 362if (bytesRead > _buffer.AvailableLength) 367_buffer.Commit(bytesRead); 442int unconsumedBytes = _buffer.ActiveLength; 447_buffer.DiscardAll();