>From the Java6 JavaDocs on InputStream

http://java.sun.com/javase/6/docs/api/java/io/InputStream.html
close

public void *close*()
           throws IOException
<http://java.sun.com/javase/6/docs/api/java/io/IOException.html>

Closes this input stream and releases any system resources associated with
the stream.

The close method of InputStream does nothing.

*Specified 
by:*close<http://java.sun.com/javase/6/docs/api/java/io/Closeable.html#close%28%29>in
interface
Closeable <http://java.sun.com/javase/6/docs/api/java/io/Closeable.html> *
Throws:* 
IOException<http://java.sun.com/javase/6/docs/api/java/io/IOException.html>-
if an I/O error occurs.
I've always been amused by the JavaDoc on this.    We close everything and
can throw an exception if an I/O error occurs.  Oh wait, we don't actually
do anything!  Just kidding!

2009/8/4 Vít Šesták <vit...@gmail.com>

>
> Correct me if I'm wrong, please: I think that InputStream.close()
> never throws an Exception, but it is not guaranteed. However, this
> isn't mistake in concept of checked exceptions. It is mistake in
> usage.
>
> 2009/8/4, Casper Bang <casper.b...@gmail.com>:
> >
> > On 4 Aug., 20:22, v6ak <v...@volny.cz> wrote:
> >> Is it really a DISadvantage when you get compile error(s) because of
> >> incompatible API?
> >
> > Let me turn it around instead. Is it a good idea how InputStream.close
> > () throws a IOException? Can anything be done about it now?
> >
> > /Casper
> > >
> >
>
> --
> Odesláno z mobilního zařízení
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to javaposse@googlegroups.com
To unsubscribe from this group, send email to 
javaposse+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to