This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes size of a ZipEntry Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "size of a ZipEntry" Watch "size of a ZipEntry" New topic
Author

size of a ZipEntry

Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3817

All,

I ran into this issue that the size (compressed, uncompressed) etc.. are not getting updated after the data has been written and the ZipEntry is closed in the ZipOutputStream (those fields should be updated automatically). That is, upon reading the entire zip file back it returns -1 (for getSize(), etc...) always for each file written. Any tips/help on this?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Martin Vanyavchich
Ranch Hand

Joined: Sep 16, 2008
Posts: 241
This might sound silly, but do you flush the stream?


SCJP 6, OCMJD 6, OCPJWSD 6
I no good English.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: size of a ZipEntry
 
Similar Threads
ZipException - invalid entry compressed size
problem using getSize on classes in jar file
Converting Zip file to bytearray and vice versa
Problem in copying files for one jar file to the other
Compressed v Uncompressed byte reading