TextReader: ReadBlock

ReadBlock

Reads a maximum of Count characters from the current stream, and writes the data to Chars, beginning at Index.



 Public Function ReadBlock(
	  ByRef Chars ( ) As Integer,
	  ByVal Index As Long,
	  ByVal Count As Long ) As Long

Parameters

Chars
[ByRef] Integer. The character array to receive Count characters from the stream.
Index
[ByVal] Long. The starting index in Chars to begin storing characters.
Count
[ByVal] Long. The maximum number of characters to be read from the stream.

Return Values

Long -  The number of characters that have been read. The number will be less than or equal to Count, depending on whether all input characters have been read.

Remarks

Characters are encoded within the stream. A single character may require more that one byte to represent it. This may result in fewer characters read than there are bytes in the stream.

Exceptions

ExceptionCondition
ArgumentNullExceptionChars is uninitialized.
ArgumentExceptionThe Char length minus Index is less than Count.
ArgumentOutOfRangeExceptionIndex or Count is negative.
ObjectDisposedExceptionThe TextReader is closed.

See Also

Project CorLib Overview

Class TextReader Overview