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

System.Text.UnicodeEncoding.GetCharCount Method

Determines the exact number of characters that will be produced by decoding the specified range of the specified array of bytes as Unicode-encoded characters. [Edit]

public override int GetCharCount (byte[] bytes, int index, int count)

Parameters

bytes
A byte array to decode as Unicode-encoded characters. [Edit]
index
A int that specifies the first index in bytes to decode. [Edit]
count
A int that specifies the number of elements in bytes to decode. [Edit]

Returns

A int whose value equals the number of characters a call to UnicodeEncoding.GetChars(Byte[], int, int, Char[], int) will produce if presented with the specified range of bytes as Unicode-encoded characters. [Edit]

Exceptions

TypeReason
ArgumentNullExceptionbytes is null. [Edit]
ArgumentOutOfRangeException

index < 0.

-or-

count < 0.

-or-

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

[Edit]

Remarks

Note: This method overrides Encoding.GetCharCount(Byte[]).
[Edit]

Requirements

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