Add method to write AmiraMesh file faster using more memory.

Instead of accessing the output file once for each slice, the whole image information is written at once.
Add method to read AmiraMesh file fast using a more memory.
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.