Returns the number of characters produced by decoding the specified range of the specified byte array as a System.Text.UTF8Encoding .
- bytes
- The byte array to decode as a System.Text.UTF8Encoding .
- index
- A int that specifies the first index of bytes to decode.
- count
- A int that specifies the number of bytes to decode.
A int that indicates the number of characters produced by decoding the range in bytes from index to index + count - 1 as a System.Text.UTF8Encoding .
Type Reason ArgumentNullException bytes is null. ArgumentOutOfRangeException index or count is less than zero.
-or-
index and count do not specify a valid range in bytes (i.e. (index + count) > bytes.Length).
ArgumentException Error-checking is turned on for the current instance and bytes contains an invalid surrogate sequence.
If error-checking is turned off and an invalid surrogate sequence is detected, the invalid bytes are ignored and do not affect the return value, and no exception is thrown.
Note: This method overrides Encoding.GetCharCount(Byte[]).
Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0