I'm writing a code with Java7 and I use the try-with-resources feature.
When I create an instance of ZipOutputStream. By doing that I no longer have to close the stream in the finally block. The try-with-resources managed that (by the JVM of course).
My question is - what about the use of closeEntry(). Should I write this method in my try block or should I delete it and the JVM will close it automatically by the try-with-resources feature just like it does with the method close()?
I'm almost sure that it is not relevant to the try-with-resources (or to the finally block) and I should do it inside my try block and not in the finally block (if I use a regular try-catch-finally), but I want to be sure about it.
Thanks!!!