Quantcast
Channel: SharpDevelop Community
Viewing all articles
Browse latest Browse all 1764

ZipInputStreamGetNextEntry Exception

$
0
0

Hi Guys,

I have a simple zip file with two entryes:

1.xml

2.xml

My code looks like this (it compiles in real life, im just making it breif here)

while((entry = zip.GetNextEntry()) != null)

{

   if(entry.name.equals("2.xml")

  {

       // then extract file

       break;

   }

}

I only care about the one file. Now I do see the first entry 1.xml but I don't care about this so skip it and call GetNextEntry again, this throws an exception complaing the stream position is negative or too big.

If i always read the file using StreamUtils.Copy then everything works inc the second GetNextEntry call.

Must you always read the data when using ZipInputStream?

Thanks,

Shyam


Viewing all articles
Browse latest Browse all 1764

Trending Articles