Mono Class Library: System.IO.TextReader Overview | Members

System.IO.TextReader.Read Method

Reads at most the specified number of characters from the current character source, and writes them to the provided character array. [Edit]

public virtual int Read (char[] buffer, int index, int count)

Parameters

buffer
A char array. When this method returns, contains the specified character array with the values between index and (index + count -1) replaced by the characters read from the current source. [Edit]
index
A int that specifies the place in buffer at which to begin writing. [Edit]
count
A int that specifies the maximum number of characters to read. If the end of the stream is reached before count of characters is read into buffer , this method returns. [Edit]

Returns

A int containing the number of characters that were read, or zero if there were no more characters left to read. Can be less than count if the end of the stream has been reached. [Edit]

Exceptions

TypeReason
ArgumentNullExceptionbuffer is null. [Edit]
ArgumentException(index + count ) > buffer.Length. [Edit]
ArgumentOutOfRangeException

index < 0

- or-

count < 0.

[Edit]
System.IO.IOExceptionAn I/O error occurred. [Edit]

Remarks

TextReader.ReadBlock(Char[], int, int) is a blocking version of this method.

Operation
The provided character array can be changed only in the specified range.

[Edit]

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0