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

System.Text.UnicodeEncoding.GetByteCount Method

Determines the exact number of bytes required to encode the specified range of the specified array of characters as Unicode-encoded characters. [Edit]

public override int GetByteCount (char[] chars, int index, int count)

Parameters

chars
A char array to encode as Unicode-encoded characters. [Edit]
index
A int that specifies the first index of chars to encode. [Edit]
count
A int that specifies the number of elements in chars to encode. [Edit]

Returns

A int whose value equals the number of bytes required to encode the range in chars from index to index + count - 1 as Unicode-encoded characters. [Edit]

Exceptions

TypeReason
ArgumentNullExceptionchars is null . [Edit]
ArgumentOutOfRangeException

index < 0.

-or-

count < 0.

-or-

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

[Edit]

Remarks

Note: This method overrides Encoding.GetByteCount(Char[]).
[Edit]

Requirements

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