<PackageReference Include="System.IO.Pipelines" Version="9.0.10" />

StreamPipeWriterOptions

Represents a set of options for controlling the creation of the PipeWriter.
using System.Buffers; using System.Runtime.CompilerServices; namespace System.IO.Pipelines { [System.Runtime.CompilerServices.NullableContext(1)] [System.Runtime.CompilerServices.Nullable(0)] public class StreamPipeWriterOptions { private const int DefaultMinimumBufferSize = 4096; internal static readonly StreamPipeWriterOptions s_default = new StreamPipeWriterOptions(null, -1, false); public int MinimumBufferSize { get; } public MemoryPool<byte> Pool { get; } public bool LeaveOpen { get; } [System.Runtime.CompilerServices.NullableContext(2)] public StreamPipeWriterOptions(MemoryPool<byte> pool = null, int minimumBufferSize = -1, bool leaveOpen = false) { Pool = (pool ?? MemoryPool<byte>.Shared); int num; if (minimumBufferSize != -1) { if (minimumBufferSize <= 0) throw new ArgumentOutOfRangeException("minimumBufferSize"); num = minimumBufferSize; } else num = 4096; MinimumBufferSize = num; LeaveOpen = leaveOpen; } } }