gzipstream rewritten to use BufferedReader for faster performance