← Interactive API Explorer
Namespace: System.IO

StreamReader

Implements a TextReader that reads characters from a byte stream in a particular encoding.

Properties (1)

Stream BaseStream
Returns the underlying stream.
Value: The underlying stream.

Methods (4)

StreamReader(IO.Stream,Text.Encoding)Constructor
Initializes a new instance of the StreamReader class for the specified stream, with the specified character encoding.
ParameterDescription
streamThe stream to be read.
encodingThe character encoding to use.
StreamReader(IO.Stream)Constructor
Initializes a new instance of the StreamReader class for the specified stream.
ParameterDescription
streamThe stream to be read.
String ReadToEnd
Reads all characters from the current position to the end of the stream.
Returns: 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 an empty string ("").
String ReadLine
Reads a line of characters from the current stream and returns the data as a string.
Returns: The next line from the input stream, or null if the end of the input stream is reached.