System.IO.TextReader.Read Method

Reads the next character from the text reader and advances the character position by one character.

Syntax

public virtual int Read ()

Returns

The next character from the text reader, or -1 if no more characters are available. The default implementation returns -1.

Exceptions

TypeReason
System.IO.IOException An I/O error occurred.

Remarks

The System.IO.TextReader class is an abstract class. Therefore, you do not instantiate it in your code. For an example of using the TextReader.Read method, see the StreamReader.Read method.

Requirements

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