Mono Class Library: System.Text.Encoding Overview | MembersSystem.Text.Encoding.GetMaxByteCount Method |
Returns the maximum number of bytes required to encode the specified number of characters, regardless of the actual character values. [Edit]
|
A int containing the maximum number of bytes required to encode charCount characters. [Edit]
Operation
As described above.Note to Inheritors
This method is overridden by types derived from System.Text.Encoding to return the appropriate number of bytes for the particular encoding.Usage
Encoding.GetMaxByteCount(int) can be used to determine the minimum buffer size for byte arrays passed to the Encoding.GetBytes(Char[]) of the current encoding. Using this minimum buffer size ensures that no buffer overflow exceptions occur. [Edit]
Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0