Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ZipOutputStream creates corrupted files when bigger than 4gb  RSS feed

 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

i hope i've chose the right forum for this issue.

i am using the zipDeflater and zipOutputStream from the java util package to create zip files.

this works just fine as long as the created zip file does not exceed 4gb of space. if it does
i am not able to open the file using win rar to view its content because the file is corrupted.

the source code that generates the zip file is down below.


thanks for help and advice..



 
Joe Ess
Bartender
Posts: 9429
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The original ZIP format had a number of limits (uncompressed size of a file, compressed size of a file and total size of the archive) at 4GB.

Zip File Format
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so what i want to do is shove it into a gzip stream ??
or are there any restrictions as well ?
 
Joe Ess
Bartender
Posts: 9429
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The package summary for java.util.zip says that the GZIP implementation is based on RFC 1952, which apparently supports files larger than 4Gb.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!