Mono Class Library: System.IO.StreamReader Overview | Members

System.IO.StreamReader.ReadToEnd Method

Reads the stream from the current position to the end of the stream.

public override string ReadToEnd ()

Returns

A int containing the rest of the stream as a string, from the current position to the end. If the current position is at the end of the stream, returns the empty string ("").

Exceptions

TypeReason
System.IO.IOExceptionAn I/O error occurred.
OutOfMemoryExceptionThere is insufficient memory to allocate a buffer for the returned string.

Remarks

Note:

This method overrides TextReader.ReadToEnd .

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0