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

System.IO.StringReader.Read Method

Reads a block of characters from the input string.

public override 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.
index
A int that specifies the starting index in the buffer.
count
A int that specifies the number of characters to read.

Returns

A int containing the total number of characters read into the buffer, or zero if the end of the underlying string has been reached.

Exceptions

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

index < 0

- or-

count < 0.

ObjectDisposedExceptionThe current reader is closed.

Remarks

Note: This method overrides TextReader.Read.

Requirements

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