Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: Task<string> ReadAllTextAsync(this Stream, Encoding, CancellationToken?)

Declaration

public static Task<string> ReadAllTextAsync(
    this Stream stream,
    Encoding encoding = null,
    CancellationToken? token = null
)

Summary

Reads all bytes from the current Stream and converts them into text using the specified encoding.

Parameters

this Streamstream Stream to read from.
Encodingencoding Encoding to expect the text to be in. If null then the UTF-8 encoding is used.
CancellationToken?token A cancellation token for this async task.

Returns

The text read from the stream.