BaseEncoding.GetBytes Method (Char[], Int32, Int32, Byte[], Int32)

CryptSharp

BaseEncodingGetBytes 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.1.0.0
Syntax

public override int GetBytes(
	char[] chars,
	int charIndex,
	int charCount,
	byte[] bytes,
	int byteIndex
)
Public Overrides Function GetBytes ( 
	chars As Char(),
	charIndex As Integer,
	charCount As Integer,
	bytes As Byte(),
	byteIndex As Integer
) As Integer
public:
virtual int GetBytes(
	array<wchar_t>^ chars, 
	int charIndex, 
	int charCount, 
	array<unsigned char>^ bytes, 
	int byteIndex
) override
abstract GetBytes : 
        chars : char[] * 
        charIndex : int * 
        charCount : int * 
        bytes : byte[] * 
        byteIndex : int -> int 
override GetBytes : 
        chars : char[] * 
        charIndex : int * 
        charCount : int * 
        bytes : byte[] * 
        byteIndex : int -> int 

Parameters

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

Return Value

Type: Int32
The actual number of bytes written into bytes.
Exceptions

ExceptionCondition
ArgumentNullExceptionchars is null.-or- bytes is null.
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.
ArgumentExceptionbytes does not have enough capacity from byteIndex to the end of the array to accommodate the resulting bytes.
EncoderFallbackExceptionA fallback occurred (see Understanding Encodings for complete explanation)-and-EncoderFallback is set to EncoderExceptionFallback.
See Also

Reference