Make sure the files and output streams are closed after writing.

This appears to cause some occasional problem in the zip writing.
Make the output stream a class field so it can be properly closed as well after writing the file.
Correct indention.
Make sure the file and input stream are closed after reading.

The input stream is now a class field.