• 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
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

UnZIPPing Exception

 
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

when trying to UNZIP large ZIP Files i got the Following Exception

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

, although my Method Working good with Small files

My Method :


I tried to change the Buffer Size but Still the Same Problem.

So , Any One Can Help Me Please???
 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the size of the zip you are trying to unzip? There's some limit on the size of zip you can handle using pre Java 7 Zip APIs, so may be that is the reason you are seeing the exception. I think the data size limit is 4GB. To handle data more than 4GB you need to be using the API which supports Zip64 format and the Java 7 supports it or you can use Apache Commons Compress 1.3 version for zip/unzip
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Size of Zip File is 1.2 GB and after UnZipping 7.8 GB
 
Mohamed Sanaulla
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ahmed Kotb wrote:Size of Zip File is 1.2 GB and after UnZipping 7.8 GB


I think this is the reason- the unzipped is more than 4GB. Which JDK version are you using?

Try using Apache Commons Compress- The process is exactly similar just that the class names are different- You have ZipArchiveEntry, ZipArchiveInputStream and so on.
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mohamed Sanaulla wrote:
Which JDK version are you using?



I am Using Version "1.6.0_21" of JAVA

Mohamed Sanaulla wrote:
Try using Apache Commons Compress



I am not the Person Who Compress the File , So I have no control on Compressing the File , I just Take the File as it and then deal with it So is there any way in Apache Commons i Can use to Uncompress the File??
 
Mohamed Sanaulla
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah you can use Apache Commons Compress API to unzip. So you can give it a try, you just have to download the jar and add it to the classpath.
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mohamed Sanaulla wrote:
Yeah you can use Apache Commons Compress API to unzip



So Please can you tell me The Jar Name and the Link I can download from it.
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mohamed Sanaulla I tried Apache Commons Library and it works Fine.
 
Mohamed Sanaulla
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad that you got it working.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic