Skip to content

StreamExtensions.ReadAllBytesAsync Method

Definition

Reads all remaining bytes from the stream asynchronously.

public static ValueTask<Byte[]> ReadAllBytesAsync(this Stream stream, CancellationToken cancellationToken = null);

Parameters

Name Type Description
stream Stream
cancellationToken CancellationToken A cancellation token.

Returns

ValueTask<Byte[]>

A byte array containing all remaining bytes from the stream.