This topic has not yet been rated - Rate this topic

BinaryReader.Read Method (Char(), Int32, Int32)

April 12, 2014

Reads count characters from the stream with index as the starting point in the character array.

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)
'Declaration
Public Overridable Function Read ( _
	buffer As Char(), _
	index As Integer, _
	count As Integer _
) As Integer

Parameters

buffer
Type: System.Char ()
The buffer to read data into.
index
Type: System.Int32
The starting point in the buffer at which to begin reading into the buffer.
count
Type: System.Int32
The number of characters to read.

Return Value

Type: System.Int32
The total number of characters read into the buffer. This might be less than the number of characters requested if that many characters are not currently available, or it might be zero if the end of the stream is reached.
ExceptionCondition
ArgumentException

The buffer length minus index is less than count.

-or-

The number of decoded characters to read is greater than count. This can happen if a Unicode decoder returns fallback characters or a surrogate pair.

ArgumentNullException

buffer is Nothing.

ArgumentOutOfRangeException

index or count is negative.

ObjectDisposedException

The stream is closed.

IOException

An I/O error occurs.

BinaryReader does not restore the file position after an unsuccessful read operation.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.