Returns the maximum number of characters produced by decoding the specified number of bytes as Unicode-encoded characters, regardless of the actual byte values.
- byteCount
- A int specifies the number of bytes to decode as Unicode-encoded characters.
A int containing the maximum number of characters that would be produced by decoding byteCount bytes as Unicode-encoded characters.
Type Reason ArgumentOutOfRangeException byteCount < 0.
Note:This method overrides Encoding.GetMaxCharCount(int).
Use this method to determine an appropriate minimum buffer size for byte arrays passed to UnicodeEncoding.GetChars(Byte[], int, int, Char[], int) or Encoding.GetChars(Byte[]) for the current instance. 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