System.Convert.ToBase64CharArray Method

Converts a subset of an 8-bit unsigned integer array to an equivalent subset of a Unicode character array encoded with base-64 digits. Parameters specify the subsets as offsets in the input and output arrays, and the number of elements in the input array to convert.

Syntax

public static int ToBase64CharArray (byte[] inArray, int offsetIn, int length, char[] outArray, int offsetOut)

Parameters

inArray
An input array of 8-bit unsigned integers.
offsetIn
A position within inArray.
length
The number of elements of inArray to convert.
outArray
An output array of Unicode characters.
offsetOut
A position within outArray.

Returns

A 32-bit signed integer containing the number of bytes in outArray.

Remarks

The subset of length elements of inArray starting at position offsetIn, are taken as a numeric value and converted to a subset of elements in outArray starting at position offsetOut. The return value indicates the number of converted elements in outArray. The subset of outArray consists of base-64 digits.

The base-64 digits in ascending order from zero are the uppercase characters "A" to "Z", the lowercase characters "a" to "z", the numerals "0" to "9", and the symbols "+" and "/". The valueless character, "=", is used for trailing padding.

The offset and length parameters are 32-bit signed numbers. The offsetIn and offsetOut parameters are zero-based array positions.

Note:

The Convert.ToBase64CharArray(Byte[], int, int, Char[], int) method is designed to process a single byte array that contains all the data to be encoded. To create a base-64 character array from a byte stream, use the System.Security.Cryptography.ToBase64Transform class.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0