Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/java/io/IOException.java
38829 views
/*1* Copyright (c) 1994, 2006, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package java.io;2627/**28* Signals that an I/O exception of some sort has occurred. This29* class is the general class of exceptions produced by failed or30* interrupted I/O operations.31*32* @author unascribed33* @see java.io.InputStream34* @see java.io.OutputStream35* @since JDK1.036*/37public38class IOException extends Exception {39static final long serialVersionUID = 7818375828146090155L;4041/**42* Constructs an {@code IOException} with {@code null}43* as its error detail message.44*/45public IOException() {46super();47}4849/**50* Constructs an {@code IOException} with the specified detail message.51*52* @param message53* The detail message (which is saved for later retrieval54* by the {@link #getMessage()} method)55*/56public IOException(String message) {57super(message);58}5960/**61* Constructs an {@code IOException} with the specified detail message62* and cause.63*64* <p> Note that the detail message associated with {@code cause} is65* <i>not</i> automatically incorporated into this exception's detail66* message.67*68* @param message69* The detail message (which is saved for later retrieval70* by the {@link #getMessage()} method)71*72* @param cause73* The cause (which is saved for later retrieval by the74* {@link #getCause()} method). (A null value is permitted,75* and indicates that the cause is nonexistent or unknown.)76*77* @since 1.678*/79public IOException(String message, Throwable cause) {80super(message, cause);81}8283/**84* Constructs an {@code IOException} with the specified cause and a85* detail message of {@code (cause==null ? null : cause.toString())}86* (which typically contains the class and detail message of {@code cause}).87* This constructor is useful for IO exceptions that are little more88* than wrappers for other throwables.89*90* @param cause91* The cause (which is saved for later retrieval by the92* {@link #getCause()} method). (A null value is permitted,93* and indicates that the cause is nonexistent or unknown.)94*95* @since 1.696*/97public IOException(Throwable cause) {98super(cause);99}100}101102103