Returns the maximum number of bytes required to encode the specified number of characters as a System.Text.UTF8Encoding, regardless of the actual character values.
- charCount
- A int that specifies the number of characters to encode as a System.Text.UTF8Encoding .
A int that specifies the maximum number of bytes required to encode charCount characters as a System.Text.UTF8Encoding .
Type Reason ArgumentOutOfRangeException charCount < 0.
Note:This method overrides Encoding.GetMaxByteCount(int) .
This method can be used to determine an appropriate buffer size for byte arrays passed to UTF8Encoding.GetBytes(Char[], int, int, Byte[], 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