Convert.FromBase64CharArray Method (Char[], Int32, Int32)
Converts a subset of a Unicode character array, which encodes binary data as base64 digits, to an equivalent 8bit unsigned integer array. Parameters specify the subset in the input array and the number of elements to convert.
Assembly: mscorlib (in mscorlib.dll)
Parameters
 inArray

Type:
System.Char[]
A Unicode character array.
 offset

Type:
System.Int32
A position within inArray.
 length

Type:
System.Int32
The number of elements in inArray to convert.
Return Value
Type: System.Byte[]An array of 8bit unsigned integers equivalent to length elements at position offset in inArray.
Exception  Condition 

ArgumentNullException  inArray is null. 
ArgumentOutOfRangeException  offset or length is less than 0. or offset plus length indicates a position not within inArray. 
FormatException  The length of inArray, ignoring whitespace characters, is not zero or a multiple of 4. or The format of inArray is invalid. inArray contains a nonbase64 character, more than two padding characters, or a nonwhitespace character among the padding characters. 
inArray is composed of base64 digits, whitespace characters, and trailing padding characters. The base64 digits in ascending order from zero are the uppercase characters "A" to "Z", lowercase characters "a" to "z", numerals "0" to "9", and the symbols "+" and "/".
The whitespace characters, and their Unicode names and hexadecimal code points, are tab (CHARACTER TABULATION, U+0009), newline (LINE FEED, U+000A), carriage return (CARRIAGE RETURN, U+000D), and blank (SPACE, U+0020). An arbitrary number of whitespace characters can appear in inArray because all whitespace characters are ignored.
The valueless character, "=", is used for trailing padding. The end of inArray can consist of zero, one, or two padding characters.
Important 

The FromBase64CharArray method is designed to process a single character array that contains all the data to be decoded. To decode base64 character data from a stream, use the System.Security.Cryptography.FromBase64Transform class. 
The following example demonstrates the use of the FromBase64CharArray(Char[], Int32, Int32) method to decode UUencoded (base64) data and save it as binary output.
The following example demonstrates the ToBase64CharArray(Byte[], Int32, Int32, Char[], Int32, Base64FormattingOptions) and FromBase64CharArray(Char[], Int32, Int32) methods. The input is divided into groups of three bytes (24 bits) each. Consequently, each group consists of four 6bit numbers where each number ranges from decimal 0 to 63. In this example, there are 85 3byte groups with one byte remaining. The first group consists of the hexadecimal values 00, 01, and 02, which yield four 6bit values equal to decimal 0, 0, 4, and 2. Those four values correspond to the base64 digits, "A", "A", "E", and "C", at the beginning of the output.
If an integral number of 3byte groups does not exist, the remaining bytes are effectively padded with zeros to form a complete group. In this example, the value of the last byte is hexadecimal FF. The first 6 bits are equal to decimal 63, which corresponds to the base64 digit "/" at the end of the output, and the next 2 bits are padded with zeros to yield decimal 48, which corresponds to the base64 digit, "w". The last two 6bit values are padding and correspond to the valueless padding character, "=".
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1