BaseEncoding GetBytes Method ( Char , Int32, Int32,  Byte , Int32)CryptSharp
When overridden in a derived class, encodes a set of characters from the specified character array into the specified byte array.

Namespace: CryptSharp.Utility
Assembly: CryptSharp (in CryptSharp.dll) Version: 2.0.0.0
Syntax

public override int GetBytes(
	char[] chars,
	int charIndex,
	int charCount,
	byte[] bytes,
	int byteIndex
)

Parameters

chars
Type:  OnlineSystem Char 
The character array containing the set of characters to encode.
charIndex
Type: OnlineSystem Int32
The index of the first character to encode.
charCount
Type: OnlineSystem Int32
The number of characters to encode.
bytes
Type:  OnlineSystem Byte 
The byte array to contain the resulting sequence of bytes.
byteIndex
Type: OnlineSystem Int32
The index at which to start writing the resulting sequence of bytes.

Return Value

The actual number of bytes written into bytes.
Exceptions

ExceptionCondition
OnlineSystem ArgumentNullExceptionchars is null.-or- bytes is null.
OnlineSystem ArgumentOutOfRangeExceptioncharIndex or charCount or byteIndex is less than zero.-or- charIndex and charCount do not denote a valid range in chars.-or- byteIndex is not a valid index in bytes.
OnlineSystem ArgumentExceptionbytes does not have enough capacity from byteIndex to the end of the array to accommodate the resulting bytes.
OnlineSystem.Text EncoderFallbackExceptionA fallback occurred (see Understanding Encodings for complete explanation)-and-OnlineEncoderFallback is set to OnlineEncoderExceptionFallback.
See Also