java.util.zip.ZipException: invalid entry size error -- help required

Hi all

I am sure this error would have been posted many number of times, but I would really appreciate if someone could help me with my problem. I am working on reading data from a .zip file, which in it has ~5GB data. All I am performing is a read operation through the piece of code specified below. I am using RHE and not using WinZip. This code worked well for .zip files handling till ~2.5GB

FileInputStream fis =new FileInputStream(filename);

BufferedInputStream bis =new BufferedInputStream(fis);

ZipInputStream zis =new ZipInputStream(bis);

StreamTokenizer tok =new StreamTokenizer( zis );

ZipEntry entry;

while((entry = zis.getNextEntry()) !=null)

{

\\read from the zip file through the streamTokenizer

}

I just print what I read through the program, on the console.

But the error I get is

java.util.zip.ZipException: invalid entry size (expected 4294967295 but got 2117536490 bytes)

at java.util.zip.ZipInputStream.readEnd(Unknown Source)

at java.util.zip.ZipInputStream.read(Unknown Source)

at java.util.zip.InflaterInputStream.read(Unknown Source)

at java.io.StreamTokenizer.read(Unknown Source)

at java.io.StreamTokenizer.nextToken(Unknown Source)

at ZipFileStreams.getMessages(ZipFileStreams.java:677)

at ZipFileStreams.main(ZipFileStreams.java:814)

Could anybody give me hints as to what am I missing and where am i going wrong. Any help would be appreciated.

Thanks

[1775 byte] By [rajanvijaya] at [2007-10-2 11:03:32]
# 1

I don't know what is wrong. I have never worked with any of the components that you are using. (just never had to read anything from a file - what can I say)

However, I assume that you do know that the largest possible value that you can hold in a 32 bit integer is somewhere around 4 billion and as soon as you mention somehting that worked around 2.5 billion and stopped working around 5 billion, you got to be suspicious that something in your pipeline was using a 32 bit integer and it overflowed

it is particularly interesting tha the exact value of the largest possible number that you can hold in an unsigned 32 integer is

4294967295

and curiously enough that is exactly one of the numbers that was listed in your invalid entry size exception.

What exactly you do with that information, I don't know but you did ask for a hint.

I would probably try to break the problem into smaller size, or at least try to track down which routine you are calling has trouble near a 32 bit boundry.

marlin314a at 2007-7-13 3:36:16 > top of Java-index,Other Topics,Algorithms...
# 2

I have lots of Zip files(each inturn containing one .dat file of ~ 4.5 gig b) which have data. All I do is read the zip files (using Buffer, StreamTokenizer etc..), process it and write the processed output to another file. Just it.

If I implement this by Unzipping the file and run the read/write processing on the .dat file, it works perfectly well. This means I am able to handle files of a bigger size and the breakdown is just on ZipStream etc.

I hope I have my problem clear.

rajanvijaya at 2007-7-13 3:36:16 > top of Java-index,Other Topics,Algorithms...