Monday, July 25, 2011

Re: [android-developers] zip Problems

On Tue, Jul 26, 2011 at 2:09 AM, New Developer <security@isscp.com> wrote:

>
> while ((entry = zis.getNextEntry()) != null) {
>    int    size;
>    byte[] buffer = new byte[2048];
>
>
>
>    FileOutputStream     fos = new FileOutputStream(entry.getName());
>    BufferedOutputStream bos = new BufferedOutputStream(fos, buffer.length);
>
>
>
>    while ((size = zis.read(buffer, 0, buffer.length)) != -1) {
>       bos.write(buffer, 0, size);
>    }
>    bos.flush();
>    bos.close();
>
> It crashes on the entry = zis.getNextEntry()
> java.io.EOFException


First check if you can extract the files with unzip or some other
desktop tool without errors.

You could try calling closeEntry() to see if that makes
a difference. You could also try using ZipFile to see
if you can iterate over all entries.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment