InputStream close « API « Java I/O Q&A





1. FindBugs: "may fail to close stream" - is this valid in case of InputStream?    stackoverflow.com

In my Java code, I start a new process, then obtain its input stream to read it:

BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
FindBugs reports an error here:
may fail to close stream
Pattern id: ...

2. Closing Java InputStreams    stackoverflow.com

Good afternoon all. I have some questions about the usage of the close() method when using Java InputStreams. From what I see and read from most developers, you should always explicitly ...

3. closing nested streams    stackoverflow.com

Possible Duplicate:
Best way to close nested streams in Java?
How we close nested streams? Closing all of them? If yes what is the order?
FileOutputStream out ...

4. Properly closing Java Process InputStream from getInputStream    stackoverflow.com

I could not find clarification of this in the documentation. But when we have a Process object and call getInputStream(), do we get a new stream that we should explicitly close when we ...

5. What happens if you dont close a InputStream    coderanch.com

I was going through some code that I will have to maintain in the future when I came across this piece of code //load config file InputStream s = new FileInputStream(fileName); Properties properties = new Properties(); properties.load(s); But the input stream s is never closed. This is a standalone Java programs and there are several such programs where the InputStream is ...

6. InputStream.close() vs garbage collection    coderanch.com

Garbage collection will only free the resources within the JVM. The resources assigned to the VM by the operating system will still be reserved. I've seen several poorly written applications run out of resources due to poorly handled database connections, sockets and files. Rule of thumb: if it has a close() method, invoke it when you are done with it. And ...

7. How to read closed inputStream    coderanch.com

Originally posted by Rohit Kumar: How to read closed inputStream? I just want to see the content of the input stream before the input stream processes, so even if any way to write the input stream to file before sent for process it. Thanks I think the description of your problem actually contradicts the subject. You basically want to ...

8. what operation does inputStream.close() does?    coderanch.com

Hi all, Recently I was coding for streaming a file from a location .I stored the stream as byte array to pass it to the calling method. But I later found tht, even if you pass the stream as such, it works well though u close your stream in the called method. Does nt closing the stream closes the data? what ...

9. finally and InputStream.close() method    forums.oracle.com

Hello, I'm reading "effective Java" by Bloch and on page 29 (avoid finalizers), if I understand fine, he says "don't put InputStream.close() inside a finally { }"; I'm not sure to have understood it right; in fact, I read many internet pages that suggest to do it! Does anyone with the book explain to me where is the point? thanks





10. Closing InputStream after sound file plays?    forums.oracle.com

11. Input stream closing during file transmission    forums.oracle.com

12. why not make InputStream "close()" abstract?    forums.oracle.com

I am reading the API for java.io.InputStream. I noticed: (1) java.io.InputStream is abstract. (2) the "close()" method is documented as doing nothing. Were I to have designed InputStream, I would have made "close()" abstract. Is there anything to be learned regarding why the API designers implemented a method that does nothing in an already abstract class? I notice the "Closeable" interface, ...