-1

I am building a Http server.

My server's primary task is to respond a request(most times texts, sometimes images) with about 50 thumbnails(10kb each, jpeg), and some String(about 150 characters).

To reduce latency I am thinking of compressing the thumbnail and the text together as a file.

Could you recommend me a good compression library for Java that excels in compressing both text and image that does not exceed 1mb in total?(I guess size if my primary concern because of my server's low bandwidth. But it has a very good hardware, so compression speed is secondary)

Pandiyan Cool
  • 6,381
  • 8
  • 51
  • 87
Jee Seok Yoon
  • 4,716
  • 9
  • 32
  • 47
  • Does this answer your question? [What is a good Java library to zip/unzip files?](https://stackoverflow.com/questions/9324933/what-is-a-good-java-library-to-zip-unzip-files) – Minhas Kamal Nov 06 '21 at 07:29

3 Answers3

6

zip4j has been the best compression library , A java open-source library to handle Zip files. even no need to handle streams.

Digital Alchemist
  • 2,324
  • 1
  • 15
  • 17
  • 10 jpegs + 15 byte txt file = 500 kb --> compressed to 77kb!!!! However, the compression size differs from 70 kb to 450kb. I should look into this. – Jee Seok Yoon Aug 14 '13 at 10:26
0

The Apache ZIP Package will probably see you right

http://commons.apache.org/proper/commons-compress/zip.html

James Robinson
  • 1,222
  • 1
  • 15
  • 43
0

If you want to zip files without usins external libraries, then classes in the package java.util.zip can do it.

S. Cambon
  • 560
  • 3
  • 9