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