Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
The number of characters produced by decoding the specified sequence of bytes.
Type Reason ArgumentNullException bytes is null. ArgumentOutOfRangeException index < 0.
-or-
count < 0.
-or-
(bytes.Length - index) < count.
To calculate the exact array size required by ASCIIEncoding.GetChars(Byte[], int, int, Char[], int) to store the resulting characters, the application uses ASCIIEncoding.GetCharCount(Byte[], int, int). To calculate the maximum array size, the application should use ASCIIEncoding.GetMaxCharCount(int). The ASCIIEncoding.GetCharCount(Byte[], int, int) method generally allows allocation of less memory, while the ASCIIEncoding.GetMaxCharCount(int) method generally executes faster.