1adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project/*
2adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project *  Licensed to the Apache Software Foundation (ASF) under one or more
3adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project *  contributor license agreements.  See the NOTICE file distributed with
4adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project *  this work for additional information regarding copyright ownership.
5adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project *  The ASF licenses this file to You under the Apache License, Version 2.0
6adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project *  (the "License"); you may not use this file except in compliance with
7adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project *  the License.  You may obtain a copy of the License at
8adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project *
9adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project *     http://www.apache.org/licenses/LICENSE-2.0
10adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project *
11adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project *  Unless required by applicable law or agreed to in writing, software
12adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project *  distributed under the License is distributed on an "AS IS" BASIS,
13adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project *  See the License for the specific language governing permissions and
15adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project *  limitations under the License.
16adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */
17adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project
18adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Projectpackage java.io;
19adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project
20adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project/**
21adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * Signals a general, I/O-related error. Error details may be specified when
22adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * calling the constructor, as usual. Note there are also several subclasses of
23adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * this class for more specific error situations, such as
24adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * {@link FileNotFoundException} or {@link EOFException}.
25adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */
26adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Projectpublic class IOException extends Exception {
27adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project
28adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project    private static final long serialVersionUID = 7818375828146090155L;
29adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project
30adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project    /**
31adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project     * Constructs a new {@code IOException} with its stack trace filled in.
32adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project     */
33adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project    public IOException() {
34adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project    }
35adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project
36adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project    /**
37adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project     * Constructs a new {@code IOException} with its stack trace and detail
38adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project     * message filled in.
3908ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes     *
40adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project     * @param detailMessage
41adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project     *            the detail message for this exception.
42adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project     */
43adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project    public IOException(String detailMessage) {
44adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project        super(detailMessage);
45adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project    }
4608ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes
4708ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes    /**
4808ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes     * Constructs a new instance of this class with detail message and cause
4908ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes     * filled in.
5008ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes     *
5108ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes     * @param message
5208ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes     *            The detail message for the exception.
5308ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes     * @param cause
5408ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes     *            The detail cause for the exception.
5508ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes     * @since 1.6
5608ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes     */
5708ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes    public IOException(String message, Throwable cause) {
5808ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes        super(message, cause);
5908ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes    }
6008ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes
6108ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes    /**
6208ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes     * Constructs a new instance of this class with its detail cause filled in.
6308ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes     *
6408ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes     * @param cause
6508ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes     *            The detail cause for the exception.
6608ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes     * @since 1.6
6708ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes     */
6808ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes    public IOException(Throwable cause) {
6908ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes        super(cause == null ? null : cause.toString(), cause);
7008ec8fd5c950cb94e12aefa08c89d78762acf18aElliott Hughes    }
71adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project}
72