Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: Task<byte[]> ReadAsync(this Stream, int, CancellationToken?)

Declaration

public static Task<byte[]> ReadAsync(
    this Stream stream,
    int length,
    CancellationToken? token = null
)

Summary

Attempts to read the specified number of bytes from the stream. If there are fewer bytes left before the end of the stream, a shorter (possibly empty) array is returned.

Parameters

this Streamstream Stream to read from.
intlength Number of bytes to read from the stream.
CancellationToken?token A cancellation token for this async task.