Home arrow Java & J2EE arrow Page 5 - GZIPping with Java

Leveraging GZIP in the Web World - Java

The gzip format is the de facto standard compression format in the UNIX and Linux worlds.  In a previous Dev Shed article titled Zip Meets Java, Kulvir demonstrated how to use the java.util.zip package to programmatically manipulate files in the ZIP format.  In this article, we’ll cover how to use the java.util.zip package to create and read files using the gzip format.

  1. GZIPping with Java
  2. GZIP vs. ZIP
  3. Enough… Let’s Write Some GZIP Code
  4. And the Other Way Around: Uncompressing Your GZIP Files (Programmatically)
  5. Leveraging GZIP in the Web World
By: Kulvir Singh Bhogal and Javid Jamae
Rating: starstarstarstarstar / 30
February 18, 2004

print this article



One very powerful application of the GZIP package is content compression before a Servlet response from a J2EE Web application.  Many application servers such as IBM WebSphere Application Server support Servlet Filtering, which is the act of modifying a Servlet’s response before sending it back to the client.  You can fairly easily create a Servlet filter that uses GZIP to compress the content that you are returning to a browser.  Most modern browsers have built-in functionality to decompress content that is returned in GZIP format.  For Websites that return a large amount of content, this technique can  tremendously reduce overall response time by minimizing network transfer time (which is often the bulk of the overall transaction).  Please refer to our references section for a link to Jayson Falkner’s article, which gives a detailed description on implementing a Servlet filter that does GZIP compression.


The gzip utility (and algorithm) were developed as a free alternative to the compress utility, which uses a patented algorithm.  You can learn more about these utilities at the GZIP website listed in our references section.  In this article, we showed you how to use the java.util.zip package to programmatically create and read files in the gzip format. The programmatic ability offered by the package is indispensable for programmers who want to write their own Java programs to create and read gzip format files.

>>> More Java & J2EE Articles          >>> More By Kulvir Singh Bhogal

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- More Java Bugs Lead to More Attacks
- Oracle's Java One Brings News, Surprises
- Oracle Patches Java Runtime Environment
- Apple Syncs Java Update with Oracle
- Spring 3.1 Java Development Framework Compat...
- Jelastic Java PaaS Availability and Pricing ...
- NetBeans 7.1 Released, Supports JavaFX 2
- SolarWinds Releases Newest Version of Java M...
- Free Monitoring Tool for Java Apps on Heroku
- Heroku Adds JCloud Platform Support, Java 7 ...
- Java SE 8 Speculation in Full Swing
- Java SE 7 Now Available
- New JVM Language and Java Reporting Tool
- Java 7 Release Update and New Eclipse Toolkit
- The Best Java Netbeans IDE Plugins

Developer Shed Affiliates


Dev Shed Tutorial Topics: