Why ZipInputStream can't read the output of ZipOutputStream?

后端 未结 5 1984
夕颜
夕颜 2021-01-18 08:20

I\'m stuck with this junit test:

public void test() throws Exception {
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    ZipOutputStream zipOu         


        
5条回答
  •  感动是毒
    2021-01-18 08:43

    Same problem here!

    ZipInputStream can't read the output of ZipOutputStream;

    new ZipFile(file) fails with an error

    no possible explanation!

    Archive viewer program opens the zip file just fine!

    SOLUTION: Uh... it wasn't a zip file after all... it was a tar called 'folder.zip'. Archive viewer was smart enough...

    To those with this problem: Double check!!!

提交回复
热议问题