Click or drag to resize
EncodingGetByteCount Method (Char, Int32, Int32)
When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters from the specified character array.

Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public abstract int GetByteCount(
	char[] chars,
	int index,
	int count
)

Parameters

chars
Type: SystemChar
The character array containing the set of characters to encode.
index
Type: SystemInt32
The index of the first character to encode.
count
Type: SystemInt32
The number of characters to encode.

Return Value

Type: Int32
The number of bytes produced by encoding the specified characters.
Exceptions
ExceptionCondition
ArgumentNullExceptionchars is null.
ArgumentOutOfRangeExceptionindex or count is less than zero.-or- index and count do not denote a valid range in chars.
EncoderFallbackExceptionA fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and-EncoderFallback is set to EncoderExceptionFallback.
See Also