在java中,gzip 压缩和解压多个文件?请各位大侠帮忙。

解决方案 »

  1.   

    请你举个具体的例子,将含有多个文件的gzip解压
      

  2.   

    是这样的,gzip的压缩就是一对一,也就是一个文件源文件压缩到一个目标文件,
    所以,一个压缩包只能解压出一个文件,是不可能存在多个文件的。这是GZIP的特性决定了的。通常,都是把多个文件用tar先压成一个包,然后在gzip。
    解压也是先unzip,然后untar得到多个文件。
    -----the gzip utility does not archive multiple files into one file.  On the contrary, gzip compresses one file into one gzip file.  In order to compress multiple files, one must first use another utility called TAR. TAR uses an archival algorithm to join multiple files into one file.  
      

  3.   

    这和我们通常使用的rar/zip都不一样。
      

  4.   

    那请问一下,在java中解压tar,应该怎样实现?
      

  5.   

    那请问一下,在java中解压tar,应该怎样实现?
      

  6.   

    用第三方库:
    http://commons.apache.org/compress/