Decodes the specified range of the specified array of bytes into the specified range of the specified array of characters for a particular encoding.
- bytes
- A byte array to decode.
- byteIndex
- A int that specifies the first index of bytes from which to decode.
- byteCount
- A int that specifies the number elements in bytes to decode.
- chars
- A char array of characters to decode into.
- charIndex
- A int that specifies the first index of chars to store the decoded bytes.
A int containing the number of characters decoded into chars for a particular encoding.
Type Reason ArgumentException chars does not contain sufficient space to store the decoded characters. ArgumentNullException bytes is null .
-or-
chars is null .
ArgumentOutOfRangeException byteIndex < 0.
-or-
byteCount < 0.
-or-
charIndex < 0.
-or-
byteIndex and byteCount do not specify a valid range in bytes (i.e. (byteIndex + byteCount ) > bytes.Length).
-or-
charIndex > chars.Length.
Note: Decoder.GetCharCount(Byte[], int, int) can be used to determine the exact number of characters that will be produced for a specified range of bytes. Alternatively, Encoding.GetMaxCharCount(int) of the System.Text.Encoding object that produced the current instance can be used to determine the maximum number of characters that might be produced for a specified number of bytes, regardless of the actual byte values.Operation
As described above.Note to Inheritors
Override this method to decode the values of a byte array for a particular encoding.Usage
Use this method to decode the elements of a byte array for a particular encoding.
Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0