private byte GetBase64Byte (char ch)
{
switch (ch) {
case '+':
return 62;
case '/':
return 63;
default:
if (ch >= 'A' && ch <= 'Z')
return (byte) (ch - 'A');
else if (ch >= 'a' && ch <= 'z')
return (byte) (ch - 'a' + 26);
else if (ch >= '0' && ch <= '9')
return (byte) (ch - '0' + 52);
else
throw new XmlException ("Invalid Base64 character was found.");
}
}