emul/mini/src/main/java/java/io/Closeable.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Wed, 23 Jan 2013 20:39:23 +0100
branchemul
changeset 554 05224402145d
parent 119 emul/src/main/java/java/io/Closeable.java@484416f2dc2c
permissions -rw-r--r--
First attempt to separate 'mini' profile from the rest of JDK APIs
jtulach@119
     1
/*
jtulach@119
     2
 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
jtulach@119
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jtulach@119
     4
 *
jtulach@119
     5
 * This code is free software; you can redistribute it and/or modify it
jtulach@119
     6
 * under the terms of the GNU General Public License version 2 only, as
jtulach@119
     7
 * published by the Free Software Foundation.  Oracle designates this
jtulach@119
     8
 * particular file as subject to the "Classpath" exception as provided
jtulach@119
     9
 * by Oracle in the LICENSE file that accompanied this code.
jtulach@119
    10
 *
jtulach@119
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
jtulach@119
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jtulach@119
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
jtulach@119
    14
 * version 2 for more details (a copy is included in the LICENSE file that
jtulach@119
    15
 * accompanied this code).
jtulach@119
    16
 *
jtulach@119
    17
 * You should have received a copy of the GNU General Public License version
jtulach@119
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
jtulach@119
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jtulach@119
    20
 *
jtulach@119
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
jtulach@119
    22
 * or visit www.oracle.com if you need additional information or have any
jtulach@119
    23
 * questions.
jtulach@119
    24
 */
jtulach@119
    25
jtulach@119
    26
package java.io;
jtulach@119
    27
jtulach@119
    28
import java.io.IOException;
jtulach@119
    29
jtulach@119
    30
/**
jtulach@119
    31
 * A {@code Closeable} is a source or destination of data that can be closed.
jtulach@119
    32
 * The close method is invoked to release resources that the object is
jtulach@119
    33
 * holding (such as open files).
jtulach@119
    34
 *
jtulach@119
    35
 * @since 1.5
jtulach@119
    36
 */
jtulach@119
    37
jtulach@119
    38
public interface Closeable extends AutoCloseable {
jtulach@119
    39
jtulach@119
    40
    /**
jtulach@119
    41
     * Closes this stream and releases any system resources associated
jtulach@119
    42
     * with it. If the stream is already closed then invoking this
jtulach@119
    43
     * method has no effect.
jtulach@119
    44
     *
jtulach@119
    45
     * @throws IOException if an I/O error occurs
jtulach@119
    46
     */
jtulach@119
    47
    public void close() throws IOException;
jtulach@119
    48
}