KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > Ostermiller > util > Base64DecodingException


1 /*
2  * Base64 decoding exception.
3  * Copyright (C) 2002 Stephen Ostermiller
4  * http://ostermiller.org/contact.pl?regarding=Java+Utilities
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * See COPYING.TXT for details.
17  */

18 package com.Ostermiller.util;
19
20 import java.io.*;
21
22 /**
23  * Exception that is thrown when an unexpected character is encountered
24  * during Base64 decoding. One could catch this exception and use
25  * the unexpected character for some other purpose such as including it
26  * with data that comes at the end of a Base64 encoded section of an email
27  * message.
28  *
29  * @author Stephen Ostermiller http://ostermiller.org/contact.pl?regarding=Java+Utilities
30  * @since ostermillerutils 1.00.00
31  */

32 public class Base64DecodingException extends IOException {
33     private char c;
34
35     /**
36      * Construct an new exception.
37      *
38      * @param message message later to be returned by a getMessage() call.
39      * @param c character that caused this error.
40      *
41      * @since ostermillerutils 1.00.00
42      */

43     public Base64DecodingException(String JavaDoc message, char c){
44         super(message);
45         this.c = c;
46     }
47
48     /**
49      * Get the character that caused this error.
50      *
51      * @return the character that caused this error.
52      *
53      * @since ostermillerutils 1.00.00
54      */

55     public char getChar(){
56         return c;
57     }
58 }
59
Popular Tags