• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Does jar compresses files per file or across all files within the jar file?

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does jar or zip compresses files on a per file basis (i.e., per entry)or across all files within the jar file?

(I can do some experiment but I just wonder what happened if you jar or zip up 2 identical 1GB file - Would the zip alogorithm compresses each file separately? Or, would it be smart enough to compress the two as a whole, and ends up with a ~< 1GB file. )
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Joseph,
I'm pretty sure the compression is based on a per file basis. Jar uses the same format as zip. And most of the zip tools I've seen tell you about the compression on a file level.
 
joseph lam
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jeanne. It sounds like I'd need to look for another solution of a "compressed drive" then. I am looking for something similar to what some versions of windows (e.g., xp) offer, where files are transparently compressed and uncompressed on the fly.

Has anybody seen something like that in a Java API? Does linux have it - so an entire mount point is transparently compressed/uncompressed..? If so, I could perhaps wrap that into Java?

Thanks,
Joe
 
What are you doing? You are supposed to be reading 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