Questions tagged «gzipinputstream»

5
GZIPInputStream逐行读取
我有一个.gz格式的文件。读取此文件的Java类是GZIPInputStream。但是,此类不会扩展Java的BufferedReader类。结果,我无法逐行读取文件。我需要这样的东西 reader = new MyGZInputStream( some constructor of GZInputStream) reader.readLine()... 我虽然创建了扩展java的Reader或BufferedReader类并使用GZIPInputStream作为其变量之一的类。 import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.Reader; import java.util.zip.GZIPInputStream; public class MyGZFilReader extends Reader { private GZIPInputStream gzipInputStream = null; char[] buf = new char[1024]; @Override public void close() throws IOException { gzipInputStream.close(); } public MyGZFilReader(String …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.