Table of Contents

DelegatingTextWriter.WriteAsync Method

Definition

Namespace
DotMake.CommandLine.Util
Assembly
DotMake.CommandLine.dll

WriteAsync(char)

Writes a character to the text stream asynchronously.

public override Task WriteAsync(char value)

Parameters

value char

The character to write to the text stream.

Returns

Task

A task that represents the asynchronous write operation.

Exceptions

ObjectDisposedException

The text writer is disposed.

InvalidOperationException

The text writer is currently in use by a previous write operation.

WriteAsync(string?)

Writes a string to the text stream asynchronously.

public override Task WriteAsync(string? value)

Parameters

value string

The string to write. If value is null, nothing is written to the text stream.

Returns

Task

A task that represents the asynchronous write operation.

Exceptions

ObjectDisposedException

The text writer is disposed.

InvalidOperationException

The text writer is currently in use by a previous write operation.

WriteAsync(char[], int, int)

Writes a subarray of characters to the text stream asynchronously.

public override Task WriteAsync(char[] buffer, int index, int count)

Parameters

buffer char[]

The character array to write data from.

index int

The character position in the buffer at which to start retrieving data.

count int

The number of characters to write.

Returns

Task

A task that represents the asynchronous write operation.

Exceptions

ArgumentNullException

buffer is null.

ArgumentException

The index plus count is greater than the buffer length.

ArgumentOutOfRangeException

index or count is negative.

ObjectDisposedException

The text writer is disposed.

InvalidOperationException

The text writer is currently in use by a previous write operation.

WriteAsync(ReadOnlyMemory<char>, CancellationToken)

Asynchronously writes a character memory region to the text stream.

public override Task WriteAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default)

Parameters

buffer ReadOnlyMemory<char>

The character memory region to write to the text stream.

cancellationToken CancellationToken

The token to monitor for cancellation requests. The default value is None.

Returns

Task

A task that represents the asynchronous write operation.