01 /*
02 * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
03 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04 *
05 * This code is free software; you can redistribute it and/or modify it
06 * under the terms of the GNU General Public License version 2 only, as
07 * published by the Free Software Foundation. Sun designates this
08 * particular file as subject to the "Classpath" exception as provided
09 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26 package javax.imageio;
27
28 import java.io.IOException;
29
30 /**
31 * An exception class used for signaling run-time failure of reading
32 * and writing operations.
33 *
34 * <p> In addition to a message string, a reference to another
35 * <code>Throwable</code> (<code>Error</code> or
36 * <code>Exception</code>) is maintained. This reference, if
37 * non-<code>null</code>, refers to the event that caused this
38 * exception to occur. For example, an <code>IOException</code> while
39 * reading from a <code>File</code> would be stored there.
40 *
41 * @version 0.5
42 */
43 public class IIOException extends IOException {
44
45 /**
46 * Constructs an <code>IIOException</code> with a given message
47 * <code>String</code>. No underlying cause is set;
48 * <code>getCause</code> will return <code>null</code>.
49 *
50 * @param message the error message.
51 *
52 * @see #getMessage
53 */
54 public IIOException(String message) {
55 super (message);
56 }
57
58 /**
59 * Constructs an <code>IIOException</code> with a given message
60 * <code>String</code> and a <code>Throwable</code> that was its
61 * underlying cause.
62 *
63 * @param message the error message.
64 * @param cause the <code>Throwable</code> (<code>Error</code> or
65 * <code>Exception</code>) that caused this exception to occur.
66 *
67 * @see #getCause
68 * @see #getMessage
69 */
70 public IIOException(String message, Throwable cause) {
71 super(message);
72 initCause(cause);
73 }
74 }
|