Saturday, December 6, 2008

I hate java, I hate java, I hate java, I hate java....etc..

So, back with Minus4j once more. I'm trying to get some ZIP support in here so that more files on Plus4world will work, but once moe=re I'm struggling to get Java to behave and do what its supposed to do. Opening a ZIP file in java is pretty is (supposedly) but will it work for me? Will it strawberry. All that should happen is I pass it an input stream and then read files, and while I appear to get no error, it also doesn't appear to actually read any file inside....Oh chocolate.

       BufferedInputStream bis = new BufferedInputStream(_stream, 16384);
try
{
ZipInputStream in = new ZipInputStream(bis);
ZipEntry entry;
while( (entry = in.getNextEntry())!=null )
{
// process the ZIP
}
in.close();
}

So in the above code, it just never gets into the inner while loop and I've no idea why - so if you have any idea...let me know. I did think it was because it was coming over HTTP, so I read it all in and build a memory stream, but that doesn't seem to matter. On top of this, no one else seems to have this problem, so I can't find any answers on the net either..... *sigh*

No comments:

Post a Comment