Skip to content

StreamToText Method ​

Definition ​

  • Namespace: JASE.IO
  • Assembly: JASE.dll

Overloads ​

NameDescription
string StreamToText(Stream stream)Reads all text from a stream to a string.
string StreamToText(Stream stream, out Encoding encoding)Reads all text from a stream to a string and reports the detected encoding.

string StreamToText(Stream stream) ​

csharp
string StreamToText(Stream stream)

Reads all text from a stream to a string.

Parameters ​

NameDescription
streamThe input stream. The stream position is preserved.

Returns ​

A string containing the stream contents, or if stream is .

string StreamToText(Stream stream, out Encoding encoding) ​

csharp
string StreamToText(Stream stream, out Encoding encoding)

Reads all text from a stream to a string and reports the detected encoding.

Parameters ​

NameDescription
encodingWhen this method returns, contains the detected encoding if available, or a default encoding if detection fails.
streamThe input stream. The stream position is preserved.

Returns ​

A string containing the stream contents, or if stream is .