Determines the exact number of bytes required to encode the specified range in the specified array of characters.
- chars
- A char array of characters to encode.
- index
- A int that specifies the first index of chars to encode.
- count
- A int that specifies the number of elements in chars to encode.
- flush
- A bool value that determines whether the current instance flushes its internal state following a conversion. Specify true to flush the internal state of the current instance following a conversion; otherwise, specify false .
A int containing the number of bytes required to encode the range in chars from index to index + count -1 for a particular encoding.
Note: This value takes into account the state in which the current instance was left following the last call to Encoder.GetBytes(Char[], int, int, Byte[], int, bool) .
Type Reason ArgumentNullException chars is null. ArgumentOutOfRangeException Return value is greater than int.MaxValue.
-or-
index < 0.
-or-
count < 0.
-or-
index and count do not specify a valid range in chars (i.e. (index + count) > chars.Length).
The state of the current instance is not affected by a call to this method.
Operation
As described above.Note to Inheritors
Override this method to retrieve the exact number of bytes required to encode a specified range of an array of char objects for a particular encoding.Usage
Use this method to determine the exact number of bytes required to encode the specified range of an array of char objects for a particular encoding.
Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0