if (ch < 0)
{
if (nByteCount == 1)
{
throw new Base64Exception("Unexpected EOF");
}
break;
}
if (ch == '=')
{
if (nByteCount < 2)
{
throw new Base64Exception("Unexpected termination character =");
}
if (nByteCount == 2)
{
ch = m_stream.read();
if (ch >= 0 && ch != '=')
{
throw new Base64Exception("Missing second termination character =");
}
}
break;
}
if (ch > 127)
{
throw new Base64Exception("Invalid character (ascii=" + ch + ")");
}
int nCode = Base64Util.DECODING_ARRAY[ch];
if (nCode >= 0)
{
nBytes <<= 6;
nBytes |= nCode;
if (++nByteCount == 4)
{
m_buf[2] = (byte)(nBytes >> 16);
m_buf[1] = (byte)(nBytes >> 8);
m_buf[0] = (byte)nBytes;
return 3;
}
}
else if (nCode == -1)
{
throw new Base64Exception("Invalid character (ascii=" + ch + ")");
}
}
if (nByteCount == 2)
{