[Kaffe] java.io.File(Input|Output)Stream question.
Moses DeJong
dejong at cs.umn.edu
Thu Feb 11 16:59:16 PST 1999
Yes, a FileNotFoundException is derived from an IOException but the
two are not interchangable. If you are writing a wrapper for the
FileReader and FileWriter you run into this problem. You can not
just throw a FileNotFoundException from your constructor because
there is no way to put a try-catch block around a super() call.
The real issue is that the IOException thrown by a FileOutputStream
seems to only happen when a FileNotFoundException could be thrown.
Am i missing something here? Is there some other kind of IOException
that could happen while opening a file for writing that would not
happen while opening a file for reading.
Mo DeJong
dejong at cs.umn.edu
On Thu, 11 Feb 1999, Tony Kimball wrote:
> Quoth Moses DeJong on Thu, 11 February:
> : A file output stream raises an IOException if the file can not be
> : found but a file input stream raises a FileNotFoundException. What
> : is going on here? Is this yet another example of a Sun screw-up that
> : we need to provide a "compatible" implementation of? This also messes
> : up the FileReader and FileWriter classes. Any thoughts?
>
> A FileNotFoundException *is* an IOException. You can return a
> FileNotFoundException in both cases compatibly, I think.
>
>
More information about the kaffe
mailing list