public PipeWriterStream(PipeWriter pipeWriter, bool leaveOpen) { Debug.Assert(pipeWriter != null); _pipeWriter = pipeWriter; LeaveOpen = leaveOpen; }
public DuplexPipe(Stream stream, StreamPipeReaderOptions?readerOptions = null, StreamPipeWriterOptions?writerOptions = null) { Input = PipeReader.Create(stream, readerOptions); Output = PipeWriter.Create(stream, writerOptions); }
public DuplexPipe(PipeReader input, PipeWriter output) { Input = input; Output = output; }
public PipeWriterStream(PipeWriter pipeWriter) { _pipeWriter = pipeWriter; }
public DuplexPipe(PipeReader reader, PipeWriter writer) { Input = reader; Output = writer; }
/// <summary> /// Copies the content of a <see cref="Stream"/> into a <see cref="PipeWriter"/>. /// </summary> /// <param name="stream"></param> /// <param name="writer"></param> /// <param name="cancellationToken"></param> /// <returns></returns> public static Task CopyToAsync(this Stream stream, PipeWriter writer, CancellationToken cancellationToken = default) { // 81920 is the default bufferSize, there is not stream.CopyToAsync overload that takes only a cancellationToken return(stream.CopyToAsync(new PipelineWriterStream(writer), bufferSize: 81920, cancellationToken: cancellationToken)); }
public PipelineWriterStream(PipeWriter writer) { _writer = writer; }
/// <summary> /// Creates a new WriteOnlyStream /// </summary> /// <param name="pipeWriter">The PipeWriter to write to.</param> /// <param name="allowSynchronousIO">Whether synchronous IO is allowed.</param> public WriteOnlyPipeStream(PipeWriter pipeWriter, bool allowSynchronousIO) { InnerPipeWriter = pipeWriter; _allowSynchronousIO = allowSynchronousIO; }
/// <summary> /// Creates a new WriteOnlyStream /// </summary> /// <param name="pipeWriter">The PipeWriter to write to.</param> public WriteOnlyPipeStream(PipeWriter pipeWriter) : this(pipeWriter, allowSynchronousIO : true) { }
public StreamPipelineWriter(PipeWriter writer) => this.writer = writer;