1 |
/* Closeable.java -- Closeable object |
/* Closeable.java -- Closeable object |
2 |
Copyright (C) 2004 Free Software Foundation |
Copyright (C) 2004, 2005 Free Software Foundation |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
37 |
|
|
38 |
package java.io; |
package java.io; |
39 |
|
|
40 |
|
/** |
41 |
|
* A <code>Closeable</code> class represents a stream of |
42 |
|
* data, which can be closed when it is no longer needed. |
43 |
|
* Closing a stream allows the resources it uses to be |
44 |
|
* freed for an alternate use. |
45 |
|
* |
46 |
|
* @author Tom Tromey (tromey@redhat.com) |
47 |
|
* @author Andrew John Hughes (gnu_andrew@member.fsf.org) |
48 |
|
* @since 1.5 |
49 |
|
*/ |
50 |
public interface Closeable |
public interface Closeable |
51 |
{ |
{ |
52 |
void close() throws IOException; |
|
53 |
|
/** |
54 |
|
* Closes the stream represented by this class, thus freeing |
55 |
|
* system resources. In that case that the stream is already |
56 |
|
* in the closed state, this method has no effect. |
57 |
|
* |
58 |
|
* @throws IOException if an I/O error occurs in closing. |
59 |
|
*/ |
60 |
|
void close() |
61 |
|
throws IOException; |
62 |
|
|
63 |
} |
} |