Mono Class Library: System.Text.Decoder Overview | Members

System.Text.Decoder.GetChars Method

Decodes the specified range of the specified array of bytes into the specified range of the specified array of characters for a particular encoding. [Edit]

public abstract int GetChars (byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)

Parameters

bytes
A byte array to decode. [Edit]
byteIndex
A int that specifies the first index of bytes from which to decode. [Edit]
byteCount
A int that specifies the number elements in bytes to decode. [Edit]
chars
A char array of characters to decode into. [Edit]
charIndex
A int that specifies the first index of chars to store the decoded bytes. [Edit]

Returns

A int containing the number of characters decoded into chars for a particular encoding. [Edit]

Exceptions

TypeReason
ArgumentExceptionchars does not contain sufficient space to store the decoded characters. [Edit]
ArgumentNullException

bytes is null .

-or-

chars is null .

[Edit]
ArgumentOutOfRangeException

byteIndex < 0.

-or-

byteCount < 0.

-or-

charIndex < 0.

-or-

byteIndex and byteCount do not specify a valid range in bytes (i.e. (byteIndex + byteCount ) > bytes.Length).

-or-

charIndex > chars.Length.

[Edit]

Remarks

Note: Decoder.GetCharCount(Byte[], int, int) can be used to determine the exact number of characters that will be produced for a specified range of bytes. Alternatively, Encoding.GetMaxCharCount(int) of the System.Text.Encoding object that produced the current instance can be used to determine the maximum number of characters that might be produced for a specified number of bytes, regardless of the actual byte values.

Operation
As described above.

Note to Inheritors
Override this method to decode the values of a byte array for a particular encoding.

Usage
Use this method to decode the elements of a byte array for a particular encoding.

[Edit]

Requirements

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