我GZIPInputStream
用来读取 gz 压缩文件,它可以工作但抛出EOFException
,我该如何解决它,谢谢。
in = new GZIPInputStream(new FileInputStream(file));
List<String> list = IOUtils.readLines(in, "UTF-8");
for (String item : list) {
System.out.println(item);
}
例外:
java.io.EOFException
at java.util.zip.GZIPInputStream.readUByte(GZIPInputStream.java:268)
at java.util.zip.GZIPInputStream.readUShort(GZIPInputStream.java:258)
at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:164)
at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:79)
at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:91)
at com.datamarket.job.controller.JobController.process(JobController.java:132)