COMPRESS-380 document DEFLATE64 support
Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/87a3cfaf Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/87a3cfaf Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/87a3cfaf Branch: refs/heads/master Commit: 87a3cfaf42bc8bdbbde3815947e2b8b4c267beee Parents: 27b16a2 Author: Stefan Bodewig <bode...@apache.org> Authored: Fri Jan 5 14:43:02 2018 +0100 Committer: Stefan Bodewig <bode...@apache.org> Committed: Fri Jan 5 14:45:01 2018 +0100 ---------------------------------------------------------------------- src/changes/changes.xml | 5 +++++ src/site/xdoc/examples.xml | 25 +++++++++++++++++++++++-- src/site/xdoc/index.xml | 7 +++++-- src/site/xdoc/limitations.xml | 2 +- src/site/xdoc/zip.xml | 36 +++++++++++++++++++++++++++++++++++- 5 files changed, 69 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-compress/blob/87a3cfaf/src/changes/changes.xml ---------------------------------------------------------------------- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 8d3bf93..3eaf692 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -72,6 +72,11 @@ The <action> type attribute can be add,update,fix,remove. throw the expected IOException rather than obscure RuntimeExceptions. </action> + <action issue="COMPRESS-380" type="add" date="2018-01-03" + due-to=""> + Added read-only DEFLATE64 support to ZIP archives and as + stand-alone CompressorInputStream. + </action> </release> <release version="1.15" date="2017-10-17" description="Release 1.15 http://git-wip-us.apache.org/repos/asf/commons-compress/blob/87a3cfaf/src/site/xdoc/examples.xml ---------------------------------------------------------------------- diff --git a/src/site/xdoc/examples.xml b/src/site/xdoc/examples.xml index b6997b3..d5d70c1 100644 --- a/src/site/xdoc/examples.xml +++ b/src/site/xdoc/examples.xml @@ -32,12 +32,12 @@ compressed) archive are archiver formats.</p> <p>The compressor formats supported are gzip, bzip2, xz, lzma, - Pack200, DEFLATE and Z, the archiver formats are 7z, ar, arj, + Pack200, DEFLATE, Brotli, DEFLATE64, ZStandard and Z, the archiver formats are 7z, ar, arj, cpio, dump, tar and zip. Pack200 is a special case as it can only compress JAR files.</p> <p>We currently only provide read support for arj, - dump and Z. arj can only read uncompressed archives, 7z can read + dump, Brotli, DEFLATE64 and Z. arj can only read uncompressed archives, 7z can read archives with many compression and encryption algorithms supported by 7z but doesn't support encryption when writing archives.</p> @@ -785,6 +785,27 @@ in.close(); </subsection> + <subsection name="DEFLATE64"> + + <p>Uncompressing a given DEFLATE64 compressed file (you would + certainly add exception handling and make sure all streams + get closed properly):</p> +<source><![CDATA[ +InputStream fin = Files.newInputStream(Paths.get("some-file")); +BufferedInputStream in = new BufferedInputStream(fin); +OutputStream out = Files.newOutputStream(Paths.get("archive.tar")); +Deflate64CompressorInputStream defIn = new Deflate64CompressorInputStream(in); +final byte[] buffer = new byte[buffersize]; +int n = 0; +while (-1 != (n = defIn.read(buffer))) { + out.write(buffer, 0, n); +} +out.close(); +defIn.close(); +]]></source> + + </subsection> + <subsection name="Snappy"> <p>There are two different "formats" used for <a http://git-wip-us.apache.org/repos/asf/commons-compress/blob/87a3cfaf/src/site/xdoc/index.xml ---------------------------------------------------------------------- diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml index ea32924..cfadd39 100644 --- a/src/site/xdoc/index.xml +++ b/src/site/xdoc/index.xml @@ -28,7 +28,7 @@ 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 and Z files. + Brotli, Zstandard, DEFLATE64 and Z files. </p> <p> The code in this component has many origins: @@ -69,6 +69,9 @@ <subsection name="What's coming in 1.16?"> <ul> <li>Support for Zstandard compression.</li> + <li>Read-only support for DEFLATE64 compression as + stand-alone CompressorInputStream and as method used in + ZIP archives.</li> </ul> </subsection> @@ -94,7 +97,7 @@ licensed <a href="https://github.com/google/brotli">Google Brotli decoder</a>. Zstandard support is provided by the BSD licensed <a href="https://github.com/luben/zstd-jni">Zstd-jni</a>. - As of Commons Compress 1.16 support for the Z and Brotli + As of Commons Compress 1.16 support for the DEFLATE64, Z and Brotli formats is read-only.</p> <p>The ar, arj, cpio, dump, tar, 7z and zip formats are supported as http://git-wip-us.apache.org/repos/asf/commons-compress/blob/87a3cfaf/src/site/xdoc/limitations.xml ---------------------------------------------------------------------- diff --git a/src/site/xdoc/limitations.xml b/src/site/xdoc/limitations.xml index e86b296..8645a9b 100644 --- a/src/site/xdoc/limitations.xml +++ b/src/site/xdoc/limitations.xml @@ -178,7 +178,7 @@ limitation of Compress' specific implementation.</li> <li>only a subset of compression methods are supported, including the most common STORED and DEFLATEd. IMPLODE, - SHRINK and BZIP2 support is read-only.</li> + SHRINK, DEFLATE64 and BZIP2 support is read-only.</li> <li>no support for encryption or multi-volume archives</li> <li>In versions prior to Compress 1.6 <code>ZipArchiveEntries</code> read from an archive will http://git-wip-us.apache.org/repos/asf/commons-compress/blob/87a3cfaf/src/site/xdoc/zip.xml ---------------------------------------------------------------------- diff --git a/src/site/xdoc/zip.xml b/src/site/xdoc/zip.xml index 6f08ba6..b857332 100644 --- a/src/site/xdoc/zip.xml +++ b/src/site/xdoc/zip.xml @@ -297,7 +297,8 @@ just fine. As of version 1.7, Commons Compress can also decompress entries compressed with the legacy SHRINK and IMPLODE algorithms of PKZIP 1.x. Version 1.11 of Commons - Compress adds read-only support for BZIP2.</p> + Compress adds read-only support for BZIP2. Version 1.16 adds + read-only support for DEFLATE64 - also known as "enhanced DEFLATE".</p> <p>The ZIP specification allows for various other compression algorithms and also supports several different ways of @@ -312,6 +313,39 @@ mechanism. Using this method it is possible to at least detect and skip the entries that can not be extracted.</p> + <table> + <thead> + <tr> + <th>Version of Apache Commons Compress</th> + <th>Supported Compression Methods</th> + <th>Supported Encryption Methods</th> + </tr> + </thead> + <tbody> + <tr> + <td>1.0 to 1.6</td> + <td>STORED, DEFLATE</td> + <td>-</td> + </tr> + <tr> + <td>1.7 to 1.10</td> + <td>STORED, DEFLATE, SHRINK, IMPLODE</td> + <td>-</td> + </tr> + <tr> + <td>1.11 to 1.15</td> + <td>STORED, DEFLATE, SHRINK, IMPLODE, BZIP2</td> + <td>-</td> + </tr> + <tr> + <td>1.16 and later</td> + <td>STORED, DEFLATE, SHRINK, IMPLODE, BZIP2, DEFLATE64 + (enhanced deflate)</td> + <td>-</td> + </tr> + </tbody> + </table> + </subsection> <subsection name="Zip64 Support" id="zip64">