Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

size of a ZipEntry  RSS feed

 
Bartender
Posts: 4047
48
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

 
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might sound silly, but do you flush the stream?
 
Popeye has his spinach. I have this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!