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

System.IO.StreamReader.Peek Method

Returns the next character in the underlying stream without advancing the position of the System.IO.StreamReader in the stream.

public override int Peek ()

Returns

The next character from the character source as a int , or -1 if at the end of the stream.

Exceptions

TypeReason
System.IO.IOExceptionAn I/O error occurred.

Remarks

Note:

This method returns -1 is when the end of the underlying stream is reached because a Unicode character can contain only values between hexadecimal 0x0000 to 0xFFFF (0 to 65535).

This method overrides TextReader.Peek.

Requirements

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