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.


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


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


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


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.


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.


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