Editar

Compartilhar via


PipeWriter Class

Definition

Defines a class that provides a pipeline to which data can be written.

public ref class PipeWriter abstract : System::Buffers::IBufferWriter<System::Byte>
public abstract class PipeWriter : System.Buffers.IBufferWriter<byte>
type PipeWriter = class
    interface IBufferWriter<byte>
Public MustInherit Class PipeWriter
Implements IBufferWriter(Of Byte)
Inheritance
PipeWriter
Implements

Constructors

PipeWriter()

Initializes a new instance of the class.

Properties

CanGetUnflushedBytes

Gets a value that indicates whether the current PipeWriter supports reporting the count of unflushed bytes.

UnflushedBytes

When overridden in a derived class, gets the count of unflushed bytes within the current writer.

Methods

Advance(Int32)

Notifies the PipeWriter that bytes bytes were written to the output Span<T> or Memory<T>. You must call GetSpan(Int32) or GetMemory(Int32) again and use the returned buffer to continue writing more data after calling Advance(Int32); you cannot write to a previously acquired buffer.

AsStream(Boolean)

Returns a Stream representation of the PipeWriter.

CancelPendingFlush()

Cancels the pending FlushAsync(CancellationToken) or WriteAsync(ReadOnlyMemory<Byte>, CancellationToken) operation without causing the operation to throw and without completing the PipeWriter. If there is no pending operation, this cancels the next operation.

Complete(Exception)

Marks the PipeWriter as being complete, meaning no more items will be written to it.

CompleteAsync(Exception)

Marks the current pipe writer instance as being complete, meaning no more data will be written to it.

CopyFromAsync(Stream, CancellationToken)

Asynchronously reads the bytes from the specified stream and writes them to the PipeWriter.

Create(Stream, StreamPipeWriterOptions)

Creates a PipeWriter wrapping the specified Stream.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
FlushAsync(CancellationToken)

Makes bytes written available to PipeReader and runs ReadAsync(CancellationToken) continuation.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetMemory(Int32)

Returns a Memory<T> to write to that is at least the requested size, as specified by the sizeHint parameter.

GetSpan(Int32)

Returns a Span<T> to write to that is at least the requested size, as specified by the sizeHint parameter.

GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OnReaderCompleted(Action<Exception,Object>, Object)
Obsolete.

Registers a callback that executes when the PipeReader side of the pipe is completed.

ToString()

Returns a string that represents the current object.

(Inherited from Object)
WriteAsync(ReadOnlyMemory<Byte>, CancellationToken)

Writes the specified byte memory range to the pipe and makes data accessible to the PipeReader.

Extension Methods

Write<T>(IBufferWriter<T>, ReadOnlySpan<T>)

Writes the contents of value to writer.

Applies to