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 Stream | stream |
Stream to read from. |
int | length |
Number of bytes to read from the stream. |
CancellationToken? | token |
A cancellation token for this async task. |