Returns the next available character without actually reading it from the input stream.
[Visual Basic] Overrides Public Function Peek() As Integer [C#] public override int Peek(); [C++] public: override int Peek(); [JScript] public override function Peek() : int;
The next character to be read, or-1 if no more characters are available.
Exception Type | Condition |
---|---|
IOException | The stream is closed. |
The current position of the stream is not changed by the StreamReader. The returned value is-1 if no more characters are available.
StreamReader Class | StreamReader Members | System.IO Namespace