Partager via


PTextReader.ReadBlock(Char[], Int32, Int32) Method

Definition

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

public:
 override int ReadBlock(cli::array <char> ^ buffer, int index, int count);
public override int ReadBlock (char[] buffer, int index, int count);
override this.ReadBlock : char[] * int * int -> int
Public Overrides Function ReadBlock (buffer As Char(), index As Integer, count As Integer) As Integer

Parameters

buffer
Char[]

When this method returns, this parameter contains the specified character array with the values between index and (index + count -1) replaced by the characters read from the current source.

index
Int32

The place in buffer at which to begin writing.

count
Int32

The maximum number of characters to read.

Returns

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.

Exceptions

An I/O error occurs.

index or count is negative.

The buffer length minus index is less than count.

buffer is null.

Applies to