是不是直接用ZipOutputStream写到后面就可以拉,不过结果不对阿
把zip原来的entry都去掉了,因如何做?请大家帮忙阿

解决方案 »

  1.   

    create a new ZipOutputStream, iterate the original zip. then append your new file to the new zip. remove the original one.
      

  2.   

    如何iterate the original zip,能否详细点?
      

  3.   

    BufferedInputStream origin = null;
                FileOutputStream dest = new   FileOutputStream("d:\\a.zip");
                ZipOutputStream out = new ZipOutputStream(new   BufferedOutputStream(dest));            byte data[] = new byte[BUFFER];            File f = new File("d:\\a.txt");
                FileInputStream fi = new   FileInputStream(f);
                    origin = new   BufferedInputStream(fi, BUFFER);
                    ZipEntry entry =new ZipEntry(f.getName());
                    out.putNextEntry(entry);
                    int count;
                    while ((count=fi.read()) != -1) 
                        out.write(count); 
                    fi.close(); 上面就压缩一个文件,请问怎么改呢?
      

  4.   

    ok,知道了
    虽然tpz_stamp(Stamp)的提示较少,不过也就你关心了一下,谢谢你啊