用java实现多文件打包成7z的包,要源码的,谢谢啊。

解决方案 »

  1.   

    BufferedInputStream in = null;
    zipOut = new ZipOutputStream(response.getOutputStream());
    in = new BufferedInputStream(ftpClient.get(new String(filename[i].getBytes("iso-8859-1"),"gbk")));
    zipOut.putNextEntry(new ZipEntry(new String(filename[i].getBytes("iso-8859-1"),"gbk")));
    int b ;
    while ((b = in.read()) != -1){
    zipOut.write(b);
    }
    in.close();
    }
    zipOut.flush();
    zipOut.close();
      

  2.   

    Runtime.getRuntime().exec("7z.exe a D:\\c.7z D:\\a.txt D:\\b.txt");
    将7-Zip的目录安装到环境变量path中