Java Util Zip - Files missing from archive (Android) -


in app, images selected user packed zip archive. problem many files missing archive (let if select 30 images, archive contains 12 or 17 may vary).

do have increase buffer value, or why of files archived , rest missing?

thanks.

the code use zipping:

public void zip(string[] files, string zipfile) throws ioexception {         file zipdirectory = new file(environment.getexternalstoragedirectory()                 + "/laborator/");         if (!zipdirectory.exists()) {             zipdirectory.mkdirs();         } else {             system.out.println("folder exists!");         }          bufferedinputstream origin = null;         zipoutputstream out = new zipoutputstream(new bufferedoutputstream(                 new fileoutputstream(environment.getexternalstoragedirectory()                         + "/laborator/" + zipfile)));         try {             byte data[] = new byte[buffer_size];              (int = 0; < files.length; i++) {                 fileinputstream fi = new fileinputstream(files[i]);                 origin = new bufferedinputstream(fi, buffer_size);                 try {                     zipentry entry = new zipentry(files[i].substring(files[i]                             .lastindexof("/") + 1));                     out.putnextentry(entry);                     int count;                     while ((count = origin.read(data, 0, buffer_size)) != -1) {                         out.write(data, 0, count);                     }                 } {                     origin.close();                 }             }         } {             out.close();             system.out.println("ziping done");             sendzip();         }     } 

list of path pass zip method:

> 04-29 11:55:44.450: i/system.out(17558): > /storage/emulated/0/pictures/messenger/received_10203971818075142.jpeg > 04-29 11:55:44.450: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150428_190814.jpg 04-29 > 11:55:44.450: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150428_190810.jpg 04-29 > 11:55:44.450: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150428_190759.jpg 04-29 > 11:55:44.450: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150428_190756.jpg 04-29 > 11:55:44.450: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150428_190754.jpg 04-29 > 11:55:44.450: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150428_190745.jpg 04-29 > 11:55:44.450: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150428_190742.jpg 04-29 > 11:55:44.450: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150428_190730.jpg 04-29 > 11:55:44.450: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150428_190724.jpg 04-29 > 11:55:44.450: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150428_190722.jpg 04-29 > 11:55:44.450: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150428_190717.jpg 04-29 > 11:55:44.450: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150428_190713.jpg 04-29 > 11:55:44.450: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150428_190709.jpg 04-29 > 11:55:44.450: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150428_182706.jpg 04-29 > 11:55:44.450: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150426_195510.jpg 04-29 > 11:55:44.450: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150426_195506.jpg 04-29 > 11:55:44.450: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150426_195504.jpg 04-29 > 11:55:44.450: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150426_195438.jpg 04-29 > 11:55:44.455: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150426_195059.jpg 04-29 > 11:55:44.455: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150426_195057.jpg 04-29 > 11:55:44.455: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150426_195055.jpg 04-29 > 11:55:44.455: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150426_195012.jpg 04-29 > 11:55:44.455: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150426_195008.jpg 04-29 > 11:55:44.455: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150426_195007.jpg 04-29 > 11:55:44.455: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150426_195005.jpg 04-29 > 11:55:44.455: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150426_194905.jpg 04-29 > 11:55:44.455: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150426_194845_hdr.jpg 04-29 > 11:55:44.455: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150426_194836_hdr.jpg 04-29 > 11:55:44.455: i/system.out(17558): > /storage/emulated/0/dcim/camera/20150426_194733.jpg 


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -