Returns the maximum number of characters produced by decoding the specified number of bytes as a System.Text.UTF8Encoding, regardless of the actual byte values.
- byteCount
- A int that specifies the number of bytes to decode as a System.Text.UTF8Encoding .
A int that specifies the maximum number of characters produced by decoding byteCount bytes as a System.Text.UTF8Encoding .
Type Reason ArgumentOutOfRangeException byteCount < 0.
Note:This method overrides Encoding.GetMaxCharCount(int) .
This method can be used to determine an appropriate minimum buffer size for character arrays passed to UTF8Encoding.GetChars(Byte[], int, int, Char[], int) . Using this minimum buffer size can help ensure that no buffer overflow exceptions will occur.
Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0