PipeReader
Defines a class that provides access to a read side of pipe.
protected PipeReader()
Initializes a new instance of the PipeReader class.
Creates a PipeReader wrapping the specified Stream.
Creates a PipeReader wrapping the specified ReadOnlySequence<T>.
Moves forward the pipeline's read cursor to after the consumed data, marking the data as processed.
Moves forward the pipeline's read cursor to after the consumed data, marking the data as processed, read and examined.
Returns a Stream representation of the PipeReader.
Cancels the pending ReadAsync operation without causing it to throw and without completing the PipeReader. If there is no pending operation, this cancels the next operation.
Signals to the producer that the consumer is done reading.
Marks the current pipe reader instance as being complete, meaning no more data will be read from it.
public virtual Task CopyToAsync(PipeWriter destination, CancellationToken cancellationToken = default)
Asynchronously reads the bytes from the PipeReader and writes them to the specified PipeWriter, using a specified cancellation token.
Asynchronously reads the bytes from the PipeReader and writes them to the specified stream, using a specified cancellation token.
Registers a callback that executes when the PipeWriter side of the pipe is completed.
Asynchronously reads a sequence of bytes from the current PipeReader.
public ValueTask<ReadResult> ReadAtLeastAsync(int minimumSize, CancellationToken cancellationToken = default)
Asynchronously reads a sequence of bytes from the current PipeReader.
protected virtual ValueTask<ReadResult> ReadAtLeastAsyncCore(int minimumSize, CancellationToken cancellationToken)
Asynchronously reads a sequence of bytes from the current PipeReader.
Attempts to synchronously read data the PipeReader.