Examples of Base64Exception


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

Examples of org.apache.cxf.common.util.Base64Exception

            break;
        case 3:
            encoded += "=";
            break;
        default:
            throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG));
        }
        return Base64Utility.decode(encoded);
    }
View Full Code Here

Examples of org.apache.cxf.common.util.Base64Exception

        try {
            char[] cd = id.toCharArray();
            return decodeChunk(cd, 0, cd.length);
        } catch (Exception e) {
            LOG.warning("Invalid base64 encoded string : " + id);
            throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e);
        }
    }
View Full Code Here

Examples of org.apache.cxf.common.util.Base64Exception

        try {
            ostream.write(decodeChunk(id, o, l));
        } catch (Exception e) {
            LOG.warning("Invalid base64 encoded string : " + new String(id));
            throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e);
        }
    }
View Full Code Here

Examples of org.apache.cxf.common.util.Base64Exception

       
        try {
            char[] cd = id.toCharArray();
            ostream.write(decodeChunk(cd, 0, cd.length));
        } catch (IOException ioe) {
            throw new Base64Exception(new Message("BASE64_DECODE_IOEXCEPTION", LOG), ioe);
        } catch (Exception e) {
            LOG.warning("Invalid base64 encoded string : " + id);
            throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e);
        }
    }
View Full Code Here

Examples of org.apache.cxf.common.util.Base64Exception

                                   int l,
                                   OutputStream ostream) throws Base64Exception {
        try {
            ostream.write(new String(encodeChunk(id, o, l)).getBytes());
        } catch (IOException e) {
            throw new Base64Exception(new Message("BASE64_ENCODE_IOEXCEPTION", LOG), e);
        }
    }
View Full Code Here

Examples of org.apache.cxf.common.util.Base64Exception

                              int l,
                              Writer writer) throws Base64Exception {
        try {
            writer.write(encodeChunk(id, o, l));
        } catch (IOException e) {
            throw new Base64Exception(new Message("BASE64_ENCODE_WRITER_IOEXCEPTION", LOG), e);
        }
    }
View Full Code Here

Examples of org.apache.cxf.common.util.Base64Exception

        try {
            char[] cd = id.toCharArray();
            return decodeChunk(cd, 0, cd.length);
        } catch (Exception e) {
            LOG.warning("Invalid base64 encoded string : " + id);
            throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e);
        }
    }
View Full Code Here

Examples of org.apache.cxf.common.util.Base64Exception

        try {
            ostream.write(decodeChunk(id, o, l));
        } catch (Exception e) {
            LOG.warning("Invalid base64 encoded string : " + new String(id));
            throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e);
        }
    }
View Full Code Here

Examples of org.apache.cxf.common.util.Base64Exception

       
        try {
            char[] cd = id.toCharArray();
            ostream.write(decodeChunk(cd, 0, cd.length));
        } catch (IOException ioe) {
            throw new Base64Exception(new Message("BASE64_DECODE_IOEXCEPTION", LOG), ioe);
        } catch (Exception e) {
            LOG.warning("Invalid base64 encoded string : " + id);
            throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.