Version

GetChars Method

When overridden in a derived class, decodes a sequence of bytes from the specified byte array into the specified character array.
Syntax
'Declaration
 
Function GetChars( _
   ByVal bytes() As Byte, _
   ByVal byteIndex As Integer, _
   ByVal byteCount As Integer, _
   ByVal chars() As Char, _
   ByVal charIndex As Integer _
) As Integer
int GetChars( 
   byte[] bytes,
   int byteIndex,
   int byteCount,
   char[] chars,
   int charIndex
)

Parameters

bytes
The byte array containing the sequence of bytes to decode.
byteIndex
The zero-based Index of the first byte to decode.
byteCount
The number of bytes to decode.
chars
The character array to contain the resulting set of characters.
charIndex
The zero-based Index at which to start writing the resulting set of characters.

Return Value

The actual number of characters written into chars.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionbytes is null.-or- chars is null.
System.ArgumentOutOfRangeExceptionbyteIndex or byteCount or charIndex is less than zero.-or- byteIndex and byteCount do not denote a valid range in bytes.-or- charIndex is not a valid Index in chars.
System.ArgumentExceptionchars does not have enough capacity from charIndex to the End of the array to accommodate the resulting characters.
System.Text.DecoderFallbackExceptionA fallback occurred (see Understanding Encodings for complete explanation).
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also