Decodes a range of bytes into a range of characters in an array.
[Visual Basic] MustOverride Public Function GetChars( _ ByVal bytes() As Byte, _ ByVal byteIndex As Integer, _ ByVal byteCount As Integer, _ ByVal chars() As Char, _ ByVal charIndex As Integer _ ) As Integer [C#] public abstract int GetChars( byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex ); [C++] public: virtual int GetChars( unsigned char* bytes[], int byteIndex, int byteCount, __wchar_t* chars[], int charIndex ) = 0; [JScript] public abstract function GetChars( bytes : Byte[], byteIndex : int, byteCount : int, chars : Char[], charIndex : int ) : int;
The number of characters decoded into the character array.
Exception Type | Condition |
---|---|
ArgumentNullException | If bytes or chars is a null reference (in Visual Basic Nothing). |
ArgumentOutOfRangeException | If byteIndex, byteCount or charIndex is less than zero. |
ArgumentOutOfRangeException | If byteIndex + byteCount is greater than the length of bytes. |
ArgumentOutOfRangeException | If charIndex + byteCount is greater than the length of chars. |
The method decodes byteCount bytes from bytes starting at index byteIndex, storing the resulting characters in chars starting at index charIndex. The decoding takes into account the state in which the decoder was left following the last call to this method.
The GetCharCount method can be used to determine the exact number of characters that will be produced for a specified range of bytes. Alternatively, the GetMaxCharCount method of the Encoding object that produced this decoder can be used to determine the maximum number of characters that will be produced for a specified number of bytes, regardless of the actual byte values.