• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Getting zip exception while decompressing a compressed file

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I developed an application for compressing / decompressing files. I used
the Sun code of ZipUtility and Winzip algorithm.

When I try to decompress a 2GB zipped file, I am getting the following excpetion but the file got decompressed as expected.

But this is working fine for small files without any exceptioin

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

The following is the code for decompression,

[ November 17, 2006: Message edited by: Joe Ess ]
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This looks like a known problem. The bug report says it is fixed in JDK 1.5.
 
dsrinikarth rangana
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not able to get from the fix available in the sun site
 
dsrinikarth rangana
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried in jdk 1.5, still it is throwing the same exception.
Help is needed, Thanks in advance
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure the input zipfile is valid? Perhaps it was created by a broken zip implementation (e.g. JDK 1.4). Try unzipping the file with other tools you have (WinZip, jar, whatever), to see if the file is a valid zip.

Also, though it shouldn't affect the problem you're currently experiencing, it looks like are writing each entry to the same target file - each time, overwriting the old file. Are you sure that's what you want to do?
 
dsrinikarth rangana
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes Jim the zip file is a valid one , I tried zipping using Winzip

Yes I need the overwriting the same file

Pls let me know any code changes needed

Also let me know can i use any third party tool or utility from my applicaion to unzip such large files

Its urgent,
thanks in advance
 
Jim Yingst
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hm, apparently this is an ongoing issue in the JDK. The previous bugfix just covered sizes from 2GB-4GB, and that's fixed, but we still can't zip/unzip files larger than 4GB. See bug 4681995. Doesn't sound like that will be fixed right away - JDK 6 seem to still contain this problem. There may be a 3rd-partly library somewhere that can do this, but I didn't find one in my quick googling. (I tried "java zip64 library".) Perhaps your best option from Java right now is to use Runtime.exec() to execute some other non-Java program, like pkzip or gzip, or even Java's jar command. (Assuming that can handle such huge files; I don't know.) That's a somewhat ugly solution, but at the moment it looks like maybe zip64 support is just not available yet as a pure-Java solution. Or, you could read the specs carefully and write your own decompressor, I suppose, but that's probably a lot harder than using exec() would be. Good luck...
 
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Files > 2G or > 4G can be (and frequently are) problematic for many programming systems, even very low level ones like C or Assembler.

This is a direct result of currently common architectures, which are still mostly 32 bit systems.

2G -> Maximum value of a signed 32 bit int
4G -> Maximum value of a unsigned 32 bit int

It is not surprising that support in Java has had (and continues to have) rough edges in this area.

Guy
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have a mostly implemented zip64 library available at TLM Software - It's available under the GPL.

We'll have ZipOutputStream implemented after Christmas, and then will be working on support for Split & Encrypted files.
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Am also facing this problem now. I tried winzip from command prompt, but as it is not free it will bring a popup to accept the licence agrements, so manual intervention is required. Thats why only option left was using windows zip utility to extract. Does anyone know how to call windows zip utility from command prompt? So that this can be called from java for extracting big files.
 
what if we put solar panels on top of the semi truck trailer? That could power this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic