Instead of writing compressed lines to the file, wait until it's decompressed then write it to the file.