Atom Feed SITE FEED   ADD TO GOOGLE READER

IOException "The handle is invalid"

The pure Java version of our program was working flawlessly. The GCJ-compiled Windows binary was not. It was throwing an IOException, "The handle is invalid". This is caused because InputStream.close() was being called multiple times. By removing a close() call, everything now works correctly.

This raises an important question: who's job is it to close an input stream? For example:
InputStream in = ...
BufferedInputStream bufferedIn = new BufferedInputStream(in);
someMethod(bufferedIn);
bufferedIn.close();


Do I still need to call in.close()?

According to the API, I should not call in.close() because BufferedInputStream.close() does that for me.