NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

TextReader.ReadBlock

Reads a maximum of count characters from the current stream and writes the data to buffer, beginning at index.

[Visual Basic]
Overridable Public Function ReadBlock( _
   ByVal buffer() As Char, _
   ByVal index As Integer, _
   ByVal count As Integer _
) As Integer
[C#]
public virtual int ReadBlock(
   char[] buffer,
   int index,
   int count
);
[C++]
public: virtual int ReadBlock(
   __wchar_t* buffer[],
   int index,
   int count
);
[JScript]
public function ReadBlock(
   buffer : Char[],
   index : int,
   count : int
) : int;

Parameters

buffer
The character array to write data to.
index
The place in buffer at which to begin writing.
count
The maximum number of characters to read.

Return Value

The number of characters that have been read. The number will be less than or equal to count, depending on whether the EOF character is encountered.

Exceptions

Exception Type Condition
ArgumentNullException buffer is a null reference (in Visual Basic Nothing).
ArgumentException The buffer length minus index is less than count.
ArgumentOutOfRangeException index or count is negative.
IOException An I/O error occurs.

Remarks

The method blocks until either count characters are read, or the end of the file is reached. This is a blocking version of Read.

See Also

TextReader Class | TextReader Members | System.IO Namespace