Ejemplo n.º 1
0
 public PipeWriterStream(PipeWriter pipeWriter, bool leaveOpen)
 {
     Debug.Assert(pipeWriter != null);
     _pipeWriter = pipeWriter;
     LeaveOpen   = leaveOpen;
 }
Ejemplo n.º 2
0
 public DuplexPipe(Stream stream, StreamPipeReaderOptions?readerOptions = null, StreamPipeWriterOptions?writerOptions = null)
 {
     Input  = PipeReader.Create(stream, readerOptions);
     Output = PipeWriter.Create(stream, writerOptions);
 }
Ejemplo n.º 3
0
 public DuplexPipe(PipeReader input, PipeWriter output)
 {
     Input  = input;
     Output = output;
 }
Ejemplo n.º 4
0
 public PipeWriterStream(PipeWriter pipeWriter)
 {
     _pipeWriter = pipeWriter;
 }
Ejemplo n.º 5
0
 public DuplexPipe(PipeReader reader, PipeWriter writer)
 {
     Input  = reader;
     Output = writer;
 }
Ejemplo n.º 6
0
 /// <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));
 }
Ejemplo n.º 7
0
 public PipelineWriterStream(PipeWriter writer)
 {
     _writer = writer;
 }
Ejemplo n.º 8
0
 /// <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;
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Creates a new WriteOnlyStream
 /// </summary>
 /// <param name="pipeWriter">The PipeWriter to write to.</param>
 public WriteOnlyPipeStream(PipeWriter pipeWriter) :
     this(pipeWriter, allowSynchronousIO : true)
 {
 }
Ejemplo n.º 10
0
 public StreamPipelineWriter(PipeWriter writer) => this.writer = writer;