Overview – Apache Commons Compress
Apache Commons Compress ™
Last Published: 26 Jul 2025
Version: 1.28.0
ApacheCon
Apache
Commons
Commons Compress
About
Asking Questions
Release History
Issue Tracking
Dependency Management
Sources
Security
License
Code of Conduct
Javadoc
Javadoc Current
Javadoc Archive
User Guide
Known Limitations
Conventions
Wiki
Project Documentation
Project Information
About
Summary
Team
Source Code Management
Issue Management
Mailing Lists
Maven Coordinates
Dependency Management
Dependencies
Dependency Convergence
CI Management
Distribution Management
Project Reports
Commons
License
Components
Sandbox
Dormant
General Information
Security
Volunteering
Contributing Patches
Building Components
Commons Parent POM
Commons Build Plugin
Commons Release Plugin
Site Publication
Releasing Components
Wiki
ASF
How the ASF works
Get Involved
Developer Resources
Code of Conduct
Sponsorship
Thanks
Apache Commons Compress™
The Apache Commons Compress library defines an API for
working with ar, cpio, Unix dump, tar, zip, gzip, XZ,
Pack200, bzip2, 7z, arj, LZMA, snappy, DEFLATE, lz4,
Brotli, Zstandard, DEFLATE64 and Z files.
The code in this component has many origins:
The bzip2, tar and zip support came from Avalon's
Excalibur, but originally from Ant, as far as life in
Apache goes. The tar package is originally Tim Endres'
public domain package. The bzip2 package is based on
the work done by Keiron Liddle as well as Julian Seward's
libbzip2
It has migrated
via:
Ant -> Avalon-Excalibur -> Commons-IO
-> Commons-Compress.
The cpio package has been contributed by Michael Kuss
and
the
jRPM
project.
The pack200 code has originally been part of the now
retired
Apache
Harmony™
project.
Status
The current release requires Java 8 or above.
For a list of changes see the
Changes Report
Documentation
The compress component is split into
compressors
and
archivers
. While
compressors
(un)compress streams that usually store a single
entry,
archivers
deal with archives that contain
structured content represented
by
ArchiveEntry
instances which in turn
usually correspond to single files or directories.
Currently the bzip2, Pack200, XZ, gzip, LZMA, brotli,
Zstandard and Z formats are
supported as compressors where gzip support is mostly provided by
the
java.util.zip
package of the Java
class library. XZ and LZMA support is provided by the public
domain
XZ for
Java
library. Brotli support is provided by the MIT
licensed
Google
Brotli decoder
. Zstandard support is provided by the BSD
licensed
Zstd-jni
As of Commons Compress 1.21 support for the DEFLATE64, Z and Brotli
formats is read-only.
The ar, arj, cpio, dump, tar, 7z and zip formats are supported as
archivers where the
zip
implementation provides capabilities that go beyond the
features found in java.util.zip. As of Commons Compress
1.21 support for the dump and arj formats is
read-only - 7z can read most compressed and encrypted
archives but only write unencrypted ones. LZMA(2) support
in 7z requires
XZ for
Java
as well.
The compress component provides abstract base classes for
compressors and archivers together with factories that can
be used to choose implementations by algorithm name. In
the case of input streams the factories can also be used
to guess the format and provide the matching
implementation.
The
user guide
contains
more detailed information and some examples.
The
known limitations and
problems
page lists the currently known problems
grouped by the format they apply to.
The
Javadoc
of the latest GIT
The
GIT
repository
can be browsed.
Releases
Download now!
Copyright © 2002-2025
The Apache Software Foundation