InputStream close()?

David Medlock noone at nowhere.com
Fri Jun 16 10:15:05 PDT 2006


Bradley Smith wrote:
> Is there some reason why the InputStream interface does not have a 
> close() method?
> 
> Thanks,
>   Bradley

Some Input streams wouldnt necessarily close.
Suppose you had a Decompressing stream over another file stream.  You 
want to close the parent stream.

If you are dealing with File InputStreams just use a Stream variable 
when you create the object:

Steam st = new File( "myfile", FileMode.In );
...
st.close();

-DavidM



More information about the Digitalmars-d-learn mailing list