Converts a Unicode character array to an 8-bit unsigned integer array.
using System;
using System.Globalization;
public class Example
{
public static void Main()
{
System.IO.StreamReader inFile;
char[] base64CharArray;
inFile = new System.IO.StreamReader("c:\\a.txt", System.Text.Encoding.ASCII);
base64CharArray = new char[inFile.BaseStream.Length];
inFile.Read(base64CharArray, 0, (int)inFile.BaseStream.Length);
inFile.Close();
// Convert the Base64 UUEncoded input into binary output.
byte[] binaryData;
binaryData = System.Convert.FromBase64CharArray(base64CharArray,
0,
base64CharArray.Length);
}
}
Related examples in the same category