EncodingGetByteCount Method (Char, Int32) |
When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters starting at the specified character pointer.
Namespace: System.TextAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public virtual int GetByteCount(
char* chars,
int count
)
Parameters
- chars
- Type: SystemChar*
A pointer to the first character to encode. - count
- Type: SystemInt32
The number of characters to encode.
Return Value
Type:
Int32The number of bytes produced by encoding the specified characters.
Exceptions Exception | Condition |
---|
ArgumentNullException | chars is null. |
ArgumentOutOfRangeException | count is less than zero. |
EncoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and-EncoderFallback is set to EncoderExceptionFallback. |
See Also