ZipInputStream examples?

Jun 28, 2011 at 4:29 PM

Hi, 

Can anyone tell me where I can find examples(if they exist) for extracting files using ZipInputStream?

thanks.

Jun 28, 2011 at 11:38 PM

so I found this example on the site:

http://cheeso.members.winisp.net/DotNetZipHelp/html/858d6a78-0e3a-949f-659e-f14ab37213ae.htm

 

I am using code that is very similar to what's in the example.. but when my code reaches the line:

while ((currentEntry = zipInputStream.GetNextEntry()) != null)

for the last time it's throwing the following exception:

ZipEntry::ReadHeader(): Bad signature (0xB8439D9F) at position  0x0000042B

Now even after I get this exception, it seems like the file was still unzipped just fine..

Any ideas?

 

Jul 1, 2011 at 6:49 PM

bump

Coordinator
Jul 5, 2011 at 2:41 AM

The documentation includes examples - you found the main one.

As regards the problem you are seeing, it generally means there was a zipentry that was not valid. Depending on how you handle the exception (catch and retry, move to next entry, etc), it could be that you would extract the other, non-corrupted entries. 

This is just a guess, not having seen your code or the zipfile itself.