EncodingGetBytes Method (Char) |
When overridden in a derived class, encodes all the characters in the specified character array into a sequence of bytes.
Namespace: System.TextAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public virtual byte[] GetBytes(
char[] chars
)
Parameters
- chars
- Type: SystemChar
The character array containing the characters to encode.
Return Value
Type:
ByteA byte array containing the results of encoding the specified set of characters.
Exceptions Exception | Condition |
---|
ArgumentNullException | chars is null. |
EncoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and-EncoderFallback is set to EncoderExceptionFallback. |
See Also