Returns the next available character without actually reading it from the input stream.
[Visual Basic] Overridable Public Function Peek() As Integer [C#] public virtual int Peek(); [C++] public: virtual int Peek(); [JScript] public function Peek() : int;
The next character to be read, or-1 if no more characters are available.
Exception Type | Condition |
---|---|
IOException | An I/O error occurs. |
The current position of the TextReader is not changed by this operation. The returned value is-1 if no more characters are available. This default method simply returns-1.