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

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

Parameters

chars
Type: SystemChar
The character array containing the characters to encode.

Return Value

Type: Int32
The number of bytes produced by encoding all the characters in the specified character array.
Exceptions
ExceptionCondition
ArgumentNullExceptionchars is null.
EncoderFallbackExceptionA fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and-EncoderFallback is set to EncoderExceptionFallback.
See Also