1 /* 2 * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * 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 */ 42 public class IIOException extends IOException { 43 44 private static final long serialVersionUID = -3216210718638985251L; 45 46 /** 47 * Constructs an <code>IIOException</code> with a given message 48 * <code>String</code>. No underlying cause is set; 49 * <code>getCause</code> will return <code>null</code>. 50 * 51 * @param message the error message. 52 * 53 * @see #getMessage 54 */ 55 public IIOException(String message) { 56 super(message); 57 } 58 59 /** 60 * Constructs an <code>IIOException</code> with a given message 61 * <code>String</code> and a <code>Throwable</code> that was its 62 * underlying cause. 63 * 64 * @param message the error message. 65 * @param cause the <code>Throwable</code> (<code>Error</code> or 66 * <code>Exception</code>) that caused this exception to occur. 67 * 68 * @see #getCause 69 * @see #getMessage 70 */ 71 public IIOException(String message, Throwable cause) { 72 super(message); 73 initCause(cause); 74 } 75 }