It closes the invoking stream and releases all the resources. It is implemented by all the I/O classes that open a stream.
Welcome to the Java Blog, written by me with the sole purpose of talking about Java & Web technologies. I'm aiming this blog at other Java developers with the deeper aspects of writing code and resolving technical issues. Hopefully I can blog about some really interesting topics as I come across them. Mr. Patricia Seybold said, "If you learn to program in Java, you’ll never be without a job!"
Friday, May 29, 2009
Closeable and Flushable interfaces
The Closeable and Flushable interfaces define a uniform way for specifying that a stream can be closed or flushed.
Closeable: The objects that implement the Closeable interface can be closed. This interface defines the close() method.
void close() throws IOException
It closes the invoking stream and releases all the resources. It is implemented by all the I/O classes that open a stream.
Flushable: The objects that implement the Flushable interface can force buffered output to be written to a stream to which the objects are attached. This interface defines the flush() method.
void flush() throws IOException
It closes the invoking stream and releases all the resources. It is implemented by all the I/O classes that open a stream.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment