Java
  Home arrow Java arrow GZIPping with Java
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

GZIPping with Java
By: Kulvir Singh Bhogal and Javid Jamae
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 26
    2004-02-18

    Table of Contents:
  • GZIPping with Java
  • GZIP vs. ZIP
  • Enough… Let’s Write Some GZIP Code
  • And the Other Way Around: Uncompressing Your GZIP Files (Programmatically)
  • Leveraging GZIP in the Web World

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    Iron Speed
     
    ADVERTISEMENT

    PCmover - $15 Off with Coupon Code CJPH7Q

    GZIPping with Java
    (Page 1 of 5 )

    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.

    Some Background About GZIP

    gzip (short for GNU zip) is a compression utility (mainly found on the *NIX platforms) that produces files with an extension of .gz.  gzip was created by by Jean-Loup Gailly and Mark Adler as a replacement for the compress utility and offers better compression ratios and an open (non-patented) compression algorithm. The sister utility, gunzip, is used to decompress files that are in the gzip format.  The intricacies of the gzip format are beyond the scope of this article. However, you can learn more about the compression and decompression algorithms used by gzip by following the link in our references section at the end of this article.  You can learn more about the format of the gzip files by reading RFCs 1951 and 1952.
     
    Some of the key points include:

    1. A lossless compressed data format

    2. Data is compressed using the LZ77 algorithm and Huffman coding

    3. Format is not covered by patents, thus making it publicly usable without fear of legal repercussion

    4. Format includes a cyclic redundancy check value to detect data corruption and ensure data integrity

    Since its inception, the gzip format has gained a popular following.  For example, the gzip utility has been formally adopted by the GNU project. There are free downloadable utilities for various platforms that can compress and decompress files in the gzip format.  In Java, the gzip functionality lives in the java.util.zip package, which has been around since Java 1.1. 

    More Java Articles
    More By Kulvir Singh Bhogal


     

       

    JAVA ARTICLES

    - Introducing the Spring Framework
    - Java Classes
    - Completing the Syntactic Comparison of Java ...
    - Syntactic Comparison of Java and C/C++
    - Java Statements
    - Conditionals, Expressions and Other Java Ope...
    - Java Operators
    - Primitive Data Types and Basic Language Rule...
    - Java and Object-Oriented Programming
    - Java Beginning Programming
    - Gaming Development Setup
    - Using RPC-Style Web Services with J2EE
    - Integrating XML with J2EE
    - Taming Tiger: Concurrent Collections
    - Combating the ‘Object Crisis’

    Iron Speed



    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway