Java Compression class

Source: Internet
Author: User

Java 1.1 also adds a class to support reading and writing to data streams in compressed format. They are encapsulated into off-the-shelf IO classes to provide compression capabilities.
One of the problems with Java 1.1 is that they are not derived from the new reader and writer classes, but are part of the InputStream and OutputStream hierarchies. So sometimes you have to mix two types of data streams (note that you can easily convert between different types with InputStreamReader and OutputStreamWriter).

Java 1.1 Compression class features

Checkedinputstream Getchecksum () produces checksums for any inputstream (not just decompression)
Checkedoutputstream Getchecksum () produces checksums for any outputstream (not just decompression)
Deflateroutputstream the base class used to compress classes
Zipoutputstream a deflateroutputstream to compress the data into a ZIP file format
Gzipoutputstream a deflateroutputstream to compress the data into a gzip file format
Inflaterinputstream the base class for extracting classes
Zipinputstream a deflaterinputstream to extract data saved in a ZIP file format
Gzipinputstream a Deflaterinputstream, extract data saved in the gzip file format

Although there are many kinds of compression algorithms, zip and gzip may be the most common. So it's easy to use a variety of ready-made tools to read and write compressed data in these formats.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.