Skip to main content
.NET Framework Class Library
BinaryReaderPeekChar Method

Returns the next available character and does not advance the byte or character position.

Namespace:   System.IO
Assemblies:   System.IO (in System.IO.dll)
  mscorlib (in mscorlib.dll)
Syntax
Public Overridable Function PeekChar As [%$TOPIC/wa0z4k5x_en-us_VS_110_1_0_0_0_0%]
public virtual [%$TOPIC/wa0z4k5x_en-us_VS_110_1_0_1_0_0%] PeekChar()
public:
virtual [%$TOPIC/wa0z4k5x_en-us_VS_110_1_0_2_0_0%] PeekChar()
abstract PeekChar : unit -> [%$TOPIC/wa0z4k5x_en-us_VS_110_1_0_3_0_0%]  
override PeekChar : unit -> [%$TOPIC/wa0z4k5x_en-us_VS_110_1_0_3_0_1%]
public function PeekChar() : [%$TOPIC/wa0z4k5x_en-us_VS_110_1_0_4_0_0%]

Return Value

Type: SystemInt32
The next available character, or -1 if no more characters are available or the stream does not support seeking.
Exceptions
ExceptionCondition
IOException

An I/O error occurs.

ArgumentException

The current character cannot be decoded into the internal character buffer by using the Encoding selected for the stream.

Remarks

If surrogate characters can be expected in the stream use the ReadChars method, then set the stream back to the original position.

For a list of common I/O tasks, see Common I/O Tasks.

Version Information

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Portable Class Library

Supported in: Portable Class Library