How to create a zip file of multiple image files

前端 未结 2 1102
猫巷女王i
猫巷女王i 2020-12-09 12:09

I am trying to create a zip file of multiple image files. I have succeeded in creating the zip file of all the images but somehow all the images have been hanged to 950 byt

2条回答
  •  天命终不由人
    2020-12-09 12:45

    Change this:

    while((length=fin.read())>0)
    

    to this:

    while((length=fin.read(b, 0, 1024))>0)
    

    And set buffer size to 1024 bytes:

    b=new byte[1024];
    

提交回复
热议问题