StreamUtility.ReadAllBytesAsync method

Reads all bytes from the stream.

public static Task<byte[]> ReadAllBytesAsync(this Stream stream, 
    CancellationToken cancellationToken = default)
parameter description
stream The stream.
cancellationToken The cancellation token.

Return Value

An array of all bytes read from the stream.

See Also