从经过gzip压缩的文件中获取InputStream。
/**NowJava.com**/ //package com.nowjava; import java.io.*; import java.util.zip.GZIPInputStream; public class Main { /** * gets an InputStream from a file that is gzip compressed. * * @param file * @return * @throws IOException */ public static InputStream getCompressedFileAsStream(final File file) throws IOException { return new GZIPInputStream(new BufferedInputStream( new FileInputStream(file))); } }