Package nexj.core.util

Examples of nexj.core.util.Base64Exception


         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)
      {
View Full Code Here

TOP

Related Classes of nexj.core.util.Base64Exception

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.