A GZIP output stream has to be told when to finish the compression and write the result to the underlying stream. close()
implicitely flushes the writer and calls finish()
on the GZIP stream.
So, call at least flush()
on the writer and finish()
or close()
of the GZIP stream, or close the writer, which will do all that and won't hurt anyway.