EncodingGetChars Method (Byte, Int32, Char, Int32) |
When overridden in a derived class, decodes a sequence of bytes starting at the specified byte pointer into a set of characters that are stored starting at the specified character pointer.
Namespace: System.TextAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public virtual int GetChars(
byte* bytes,
int byteCount,
char* chars,
int charCount
)
Parameters
- bytes
- Type: SystemByte*
A pointer to the first byte to decode. - byteCount
- Type: SystemInt32
The number of bytes to decode. - chars
- Type: SystemChar*
A pointer to the location at which to start writing the resulting set of characters. - charCount
- Type: SystemInt32
The maximum number of characters to write.
Return Value
Type:
Int32The actual number of characters written at the location indicated by the
chars parameter.
Exceptions Exception | Condition |
---|
ArgumentNullException | bytes is null.-or- chars is null. |
ArgumentOutOfRangeException | byteCount or charCount is less than zero. |
ArgumentException | charCount is less than the resulting number of characters. |
DecoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and-DecoderFallback is set to DecoderExceptionFallback. |
See Also