xref: /aosp_15_r20/external/apache-commons-compress/src/site/xdoc/limitations.xml (revision ba8755cb0ae00084b4d58129cd522613d3299f27)
1*ba8755cbSAndroid Build Coastguard Worker<?xml version="1.0"?>
2*ba8755cbSAndroid Build Coastguard Worker<!--
3*ba8755cbSAndroid Build Coastguard Worker   Licensed to the Apache Software Foundation (ASF) under one or more
4*ba8755cbSAndroid Build Coastguard Worker   contributor license agreements.  See the NOTICE file distributed with
5*ba8755cbSAndroid Build Coastguard Worker   this work for additional information regarding copyright ownership.
6*ba8755cbSAndroid Build Coastguard Worker   The ASF licenses this file to You under the Apache License, Version 2.0
7*ba8755cbSAndroid Build Coastguard Worker   (the "License"); you may not use this file except in compliance with
8*ba8755cbSAndroid Build Coastguard Worker   the License.  You may obtain a copy of the License at
9*ba8755cbSAndroid Build Coastguard Worker
10*ba8755cbSAndroid Build Coastguard Worker       http://www.apache.org/licenses/LICENSE-2.0
11*ba8755cbSAndroid Build Coastguard Worker
12*ba8755cbSAndroid Build Coastguard Worker   Unless required by applicable law or agreed to in writing, software
13*ba8755cbSAndroid Build Coastguard Worker   distributed under the License is distributed on an "AS IS" BASIS,
14*ba8755cbSAndroid Build Coastguard Worker   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15*ba8755cbSAndroid Build Coastguard Worker   See the License for the specific language governing permissions and
16*ba8755cbSAndroid Build Coastguard Worker   limitations under the License.
17*ba8755cbSAndroid Build Coastguard Worker-->
18*ba8755cbSAndroid Build Coastguard Worker<document>
19*ba8755cbSAndroid Build Coastguard Worker   <properties>
20*ba8755cbSAndroid Build Coastguard Worker      <title>Known Limitations and Problems</title>
21*ba8755cbSAndroid Build Coastguard Worker   </properties>
22*ba8755cbSAndroid Build Coastguard Worker
23*ba8755cbSAndroid Build Coastguard Worker   <body>
24*ba8755cbSAndroid Build Coastguard Worker     <p>This page lists the known limitations and problems of Apache
25*ba8755cbSAndroid Build Coastguard Worker     Commons Compress&#x2122; grouped by the archiving/compression
26*ba8755cbSAndroid Build Coastguard Worker     format they apply to.</p>
27*ba8755cbSAndroid Build Coastguard Worker
28*ba8755cbSAndroid Build Coastguard Worker     <section name="General">
29*ba8755cbSAndroid Build Coastguard Worker       <ul>
30*ba8755cbSAndroid Build Coastguard Worker         <li>Several implementations of decompressors and unarchivers will
31*ba8755cbSAndroid Build Coastguard Worker         invoke <a
32*ba8755cbSAndroid Build Coastguard Worker         href="https://docs.oracle.com/javase/10/docs/api/java/io/InputStream.html#skip(long)"><code>skip</code></a>
33*ba8755cbSAndroid Build Coastguard Worker         on the underlying <code>InputStream</code> which may throw an
34*ba8755cbSAndroid Build Coastguard Worker         <code>IOException</code> in some stream implementations. One
35*ba8755cbSAndroid Build Coastguard Worker         known case where this happens is when using
36*ba8755cbSAndroid Build Coastguard Worker         <code>System.in</code> as input. If you encounter an
37*ba8755cbSAndroid Build Coastguard Worker         exception with a message like "Illegal seek" we recommend you
38*ba8755cbSAndroid Build Coastguard Worker         wrap your stream in a <code>SkipShieldingInputStream</code>
39*ba8755cbSAndroid Build Coastguard Worker         from our utils package before passing it to Compress.</li>
40*ba8755cbSAndroid Build Coastguard Worker       </ul>
41*ba8755cbSAndroid Build Coastguard Worker     </section>
42*ba8755cbSAndroid Build Coastguard Worker
43*ba8755cbSAndroid Build Coastguard Worker     <section name="7Z">
44*ba8755cbSAndroid Build Coastguard Worker       <ul>
45*ba8755cbSAndroid Build Coastguard Worker         <li>the format requires the otherwise optional <a
46*ba8755cbSAndroid Build Coastguard Worker         href="https://tukaani.org/xz/java.html">XZ for Java</a>
47*ba8755cbSAndroid Build Coastguard Worker         library.</li>
48*ba8755cbSAndroid Build Coastguard Worker         <li>only <code>File</code>s are supported as input/output,
49*ba8755cbSAndroid Build Coastguard Worker         not streams. Starting with Compress 1.13
50*ba8755cbSAndroid Build Coastguard Worker         <code>SeekableByteChannel</code> is supported as well.</li>
51*ba8755cbSAndroid Build Coastguard Worker         <li>In Compress 1.7
52*ba8755cbSAndroid Build Coastguard Worker         <code>ArchiveStreamFactory</code> will not auto-detect 7z
53*ba8755cbSAndroid Build Coastguard Worker         archives, starting with 1.8 it will throw a
54*ba8755cbSAndroid Build Coastguard Worker         <code>StreamingNotSupportedException</code> when reading from
55*ba8755cbSAndroid Build Coastguard Worker         a 7z archive.</li>
56*ba8755cbSAndroid Build Coastguard Worker         <li>Encryption, solid compression and header compression and
57*ba8755cbSAndroid Build Coastguard Worker         are only supported when reading archives</li>
58*ba8755cbSAndroid Build Coastguard Worker         <li>Commons Compress 1.12 and earlier didn't support writing
59*ba8755cbSAndroid Build Coastguard Worker         LZMA.</li>
60*ba8755cbSAndroid Build Coastguard Worker         <li>Several of the "methods" supported by 7z are not
61*ba8755cbSAndroid Build Coastguard Worker         implemented in Compress.</li>
62*ba8755cbSAndroid Build Coastguard Worker         <li>No support for multi-volume archives</li>
63*ba8755cbSAndroid Build Coastguard Worker         <li>Support for some BCJ filters and the DELTA filter has
64*ba8755cbSAndroid Build Coastguard Worker         been added with Compress 1.8.  Because of a known bug in
65*ba8755cbSAndroid Build Coastguard Worker         version 1.4 of the <a
66*ba8755cbSAndroid Build Coastguard Worker         href="https://tukaani.org/xz/java.html">XZ for Java</a>
67*ba8755cbSAndroid Build Coastguard Worker         library, archives using BCJ filters will cause an
68*ba8755cbSAndroid Build Coastguard Worker         <code>AssertionError</code> when read.  If you need support
69*ba8755cbSAndroid Build Coastguard Worker         for BCJ filters you must use XZ for Java 1.5 or later.</li>
70*ba8755cbSAndroid Build Coastguard Worker       </ul>
71*ba8755cbSAndroid Build Coastguard Worker     </section>
72*ba8755cbSAndroid Build Coastguard Worker     <section name="AR">
73*ba8755cbSAndroid Build Coastguard Worker       <ul>
74*ba8755cbSAndroid Build Coastguard Worker         <li>AR archives can not contain directories - this is a
75*ba8755cbSAndroid Build Coastguard Worker         limitation of the format rather than one of Compress'
76*ba8755cbSAndroid Build Coastguard Worker         implementation.</li>
77*ba8755cbSAndroid Build Coastguard Worker         <li>file names longer than 16 characters are only fully
78*ba8755cbSAndroid Build Coastguard Worker         supported using the BSD dialect, the GNU/SRV4 dialect is only
79*ba8755cbSAndroid Build Coastguard Worker         supported when reading archives.</li>
80*ba8755cbSAndroid Build Coastguard Worker       </ul>
81*ba8755cbSAndroid Build Coastguard Worker     </section>
82*ba8755cbSAndroid Build Coastguard Worker     <section name="ARJ">
83*ba8755cbSAndroid Build Coastguard Worker       <ul>
84*ba8755cbSAndroid Build Coastguard Worker         <li>read-only support</li>
85*ba8755cbSAndroid Build Coastguard Worker         <li>no support for compression, encryption or multi-volume
86*ba8755cbSAndroid Build Coastguard Worker         archives</li>
87*ba8755cbSAndroid Build Coastguard Worker       </ul>
88*ba8755cbSAndroid Build Coastguard Worker     </section>
89*ba8755cbSAndroid Build Coastguard Worker     <section name="Brotli">
90*ba8755cbSAndroid Build Coastguard Worker       <ul>
91*ba8755cbSAndroid Build Coastguard Worker         <li>the format requires the otherwise optional <a
92*ba8755cbSAndroid Build Coastguard Worker         href="https://github.com/google/brotli">Google Brotli dec</a>
93*ba8755cbSAndroid Build Coastguard Worker         library.</li>
94*ba8755cbSAndroid Build Coastguard Worker         <li>read-only support</li>
95*ba8755cbSAndroid Build Coastguard Worker         <li><code>CompressorStreamFactory</code> is not able to auto-detect
96*ba8755cbSAndroid Build Coastguard Worker         streams using Brotli compression.</li>
97*ba8755cbSAndroid Build Coastguard Worker       </ul>
98*ba8755cbSAndroid Build Coastguard Worker     </section>
99*ba8755cbSAndroid Build Coastguard Worker     <section name="BZIP2">
100*ba8755cbSAndroid Build Coastguard Worker       <p>Versions of Compress prior to 1.4.1 are vulnerable to a
101*ba8755cbSAndroid Build Coastguard Worker       possible denial of service attack, see the <a
102*ba8755cbSAndroid Build Coastguard Worker       href="security.html">Security Reports</a> page for details.</p>
103*ba8755cbSAndroid Build Coastguard Worker     </section>
104*ba8755cbSAndroid Build Coastguard Worker     <section name="CPIO">
105*ba8755cbSAndroid Build Coastguard Worker       <p>We are not aware of any problems.</p>
106*ba8755cbSAndroid Build Coastguard Worker     </section>
107*ba8755cbSAndroid Build Coastguard Worker     <section name="DEFLATE">
108*ba8755cbSAndroid Build Coastguard Worker       <ul>
109*ba8755cbSAndroid Build Coastguard Worker         <li><code>CompressorStreamFactory</code> is not able to auto-detect
110*ba8755cbSAndroid Build Coastguard Worker         streams using DEFLATE compression.</li>
111*ba8755cbSAndroid Build Coastguard Worker       </ul>
112*ba8755cbSAndroid Build Coastguard Worker     </section>
113*ba8755cbSAndroid Build Coastguard Worker     <section name="DEFLATE64">
114*ba8755cbSAndroid Build Coastguard Worker       <ul>
115*ba8755cbSAndroid Build Coastguard Worker         <li><code>CompressorStreamFactory</code> is not able to auto-detect
116*ba8755cbSAndroid Build Coastguard Worker         streams using DEFLATE64 compression.</li>
117*ba8755cbSAndroid Build Coastguard Worker         <li>read-only support</li>
118*ba8755cbSAndroid Build Coastguard Worker       </ul>
119*ba8755cbSAndroid Build Coastguard Worker     </section>
120*ba8755cbSAndroid Build Coastguard Worker     <section name="DUMP">
121*ba8755cbSAndroid Build Coastguard Worker       <ul>
122*ba8755cbSAndroid Build Coastguard Worker         <li>read-only support</li>
123*ba8755cbSAndroid Build Coastguard Worker         <li>only the new-fs format is supported</li>
124*ba8755cbSAndroid Build Coastguard Worker         <li>the only compression algorithm supported is zlib</li>
125*ba8755cbSAndroid Build Coastguard Worker       </ul>
126*ba8755cbSAndroid Build Coastguard Worker     </section>
127*ba8755cbSAndroid Build Coastguard Worker     <section name="GZIP">
128*ba8755cbSAndroid Build Coastguard Worker       <p>We are not aware of any problems.</p>
129*ba8755cbSAndroid Build Coastguard Worker     </section>
130*ba8755cbSAndroid Build Coastguard Worker     <section name="JAR">
131*ba8755cbSAndroid Build Coastguard Worker       <p>JAR archives are special ZIP archives, all limitations of <a
132*ba8755cbSAndroid Build Coastguard Worker       href="#ZIP">ZIP</a> apply to JAR as well.</p>
133*ba8755cbSAndroid Build Coastguard Worker       <ul>
134*ba8755cbSAndroid Build Coastguard Worker         <li><code>ArchiveStreamFactory</code> cannot tell JAR
135*ba8755cbSAndroid Build Coastguard Worker         archives from ZIP archives and will not auto-detect
136*ba8755cbSAndroid Build Coastguard Worker         JARs.</li>
137*ba8755cbSAndroid Build Coastguard Worker         <li>Compress doesn't provide special access to the archive's
138*ba8755cbSAndroid Build Coastguard Worker         MANIFEST</li>
139*ba8755cbSAndroid Build Coastguard Worker       </ul>
140*ba8755cbSAndroid Build Coastguard Worker     </section>
141*ba8755cbSAndroid Build Coastguard Worker     <section name="LZ4">
142*ba8755cbSAndroid Build Coastguard Worker       <ul>
143*ba8755cbSAndroid Build Coastguard Worker         <li>In theory LZ4 compressed streams can contain literals and
144*ba8755cbSAndroid Build Coastguard Worker         copies of arbitrary length while Commons Compress only
145*ba8755cbSAndroid Build Coastguard Worker         supports sizes up to 2<sup>63</sup> - 1 (i.e. &#x2248; 9.2
146*ba8755cbSAndroid Build Coastguard Worker         EB).</li>
147*ba8755cbSAndroid Build Coastguard Worker       </ul>
148*ba8755cbSAndroid Build Coastguard Worker     </section>
149*ba8755cbSAndroid Build Coastguard Worker     <section name="LZMA">
150*ba8755cbSAndroid Build Coastguard Worker       <ul>
151*ba8755cbSAndroid Build Coastguard Worker         <li>the format requires the otherwise optional <a
152*ba8755cbSAndroid Build Coastguard Worker         href="https://tukaani.org/xz/java.html">XZ for Java</a>
153*ba8755cbSAndroid Build Coastguard Worker         library.</li>
154*ba8755cbSAndroid Build Coastguard Worker         <li>Commons Compress 1.12 and earlier only support reading
155*ba8755cbSAndroid Build Coastguard Worker         the format</li>
156*ba8755cbSAndroid Build Coastguard Worker       </ul>
157*ba8755cbSAndroid Build Coastguard Worker     </section>
158*ba8755cbSAndroid Build Coastguard Worker     <section name="PACK200">
159*ba8755cbSAndroid Build Coastguard Worker       <p>We are not aware of any problems.</p>
160*ba8755cbSAndroid Build Coastguard Worker     </section>
161*ba8755cbSAndroid Build Coastguard Worker     <section name="SNAPPY">
162*ba8755cbSAndroid Build Coastguard Worker       <ul>
163*ba8755cbSAndroid Build Coastguard Worker         <li>Commons Compress 1.13 and earlier only support reading
164*ba8755cbSAndroid Build Coastguard Worker         the format</li>
165*ba8755cbSAndroid Build Coastguard Worker       </ul>
166*ba8755cbSAndroid Build Coastguard Worker     </section>
167*ba8755cbSAndroid Build Coastguard Worker     <section name="TAR">
168*ba8755cbSAndroid Build Coastguard Worker       <ul>
169*ba8755cbSAndroid Build Coastguard Worker         <li>sparse files can neither be read nor written</li>
170*ba8755cbSAndroid Build Coastguard Worker         <li>only a subset of the GNU and POSIX extensions are
171*ba8755cbSAndroid Build Coastguard Worker         supported</li>
172*ba8755cbSAndroid Build Coastguard Worker         <li>In Compress 1.6 <code>TarArchiveInputStream</code> could
173*ba8755cbSAndroid Build Coastguard Worker         fail to read the full contents of an entry unless the stream
174*ba8755cbSAndroid Build Coastguard Worker         was wrapped in a buffering stream.</li>
175*ba8755cbSAndroid Build Coastguard Worker       </ul>
176*ba8755cbSAndroid Build Coastguard Worker     </section>
177*ba8755cbSAndroid Build Coastguard Worker     <section name="XZ">
178*ba8755cbSAndroid Build Coastguard Worker       <ul>
179*ba8755cbSAndroid Build Coastguard Worker         <li>the format requires the otherwise optional <a
180*ba8755cbSAndroid Build Coastguard Worker         href="https://tukaani.org/xz/java.html">XZ for Java</a>
181*ba8755cbSAndroid Build Coastguard Worker         library.</li>
182*ba8755cbSAndroid Build Coastguard Worker       </ul>
183*ba8755cbSAndroid Build Coastguard Worker     </section>
184*ba8755cbSAndroid Build Coastguard Worker     <section name="Z">
185*ba8755cbSAndroid Build Coastguard Worker       <ul>
186*ba8755cbSAndroid Build Coastguard Worker         <li>Prior to Compress 1.8.1
187*ba8755cbSAndroid Build Coastguard Worker         <code>CompressorStreamFactory</code> was not able to
188*ba8755cbSAndroid Build Coastguard Worker         auto-detect streams using .Z compression.</li>
189*ba8755cbSAndroid Build Coastguard Worker         <li>read-only support</li>
190*ba8755cbSAndroid Build Coastguard Worker       </ul>
191*ba8755cbSAndroid Build Coastguard Worker     </section>
192*ba8755cbSAndroid Build Coastguard Worker     <section name="ZIP">
193*ba8755cbSAndroid Build Coastguard Worker       <ul>
194*ba8755cbSAndroid Build Coastguard Worker         <li><code>ZipArchiveInputStream</code> is limited and may
195*ba8755cbSAndroid Build Coastguard Worker         even return false contents in some cases, use
196*ba8755cbSAndroid Build Coastguard Worker         <code>ZipFile</code> whenever possible.  See <a
197*ba8755cbSAndroid Build Coastguard Worker         href="zip.html#ZipArchiveInputStream_vs_ZipFile">the ZIP
198*ba8755cbSAndroid Build Coastguard Worker         documentation page</a> for details.  This limitation is a
199*ba8755cbSAndroid Build Coastguard Worker         result of streaming data vs using random access and not a
200*ba8755cbSAndroid Build Coastguard Worker         limitation of Compress' specific implementation.</li>
201*ba8755cbSAndroid Build Coastguard Worker         <li>only a subset of compression methods are supported,
202*ba8755cbSAndroid Build Coastguard Worker         including the most common STORED and DEFLATEd.  IMPLODE,
203*ba8755cbSAndroid Build Coastguard Worker         SHRINK, DEFLATE64 and BZIP2 support is read-only.</li>
204*ba8755cbSAndroid Build Coastguard Worker         <li>no support for encryption or multi-volume archives</li>
205*ba8755cbSAndroid Build Coastguard Worker         <li>In versions prior to Compress 1.6
206*ba8755cbSAndroid Build Coastguard Worker         <code>ZipArchiveEntries</code> read from an archive will
207*ba8755cbSAndroid Build Coastguard Worker         contain non-zero millisecond values when using Java8 rather
208*ba8755cbSAndroid Build Coastguard Worker         than the expected two-second granularity.</li>
209*ba8755cbSAndroid Build Coastguard Worker         <li>Compress 1.7 has a known bug where the very first entry
210*ba8755cbSAndroid Build Coastguard Worker         of an archive will not be read correctly by
211*ba8755cbSAndroid Build Coastguard Worker         <code>ZipArchiveInputStream</code> if it used the STORED
212*ba8755cbSAndroid Build Coastguard Worker         method.</li>
213*ba8755cbSAndroid Build Coastguard Worker         <li><code>ZipArchiveEntry#getLastModifiedDate</code> uses
214*ba8755cbSAndroid Build Coastguard Worker         <code>ZipEntry#getTime</code> under the covers which may
215*ba8755cbSAndroid Build Coastguard Worker         return different times for the same archive when using
216*ba8755cbSAndroid Build Coastguard Worker         different versions of Java.</li>
217*ba8755cbSAndroid Build Coastguard Worker         <li>In versions of Compress prior to 1.16 a specially crafted
218*ba8755cbSAndroid Build Coastguard Worker         ZIP archive can be used to cause an infinite loop inside of
219*ba8755cbSAndroid Build Coastguard Worker         Compress' extra field parser used by the <code>ZipFile</code>
220*ba8755cbSAndroid Build Coastguard Worker         and <code>ZipArchiveInputStream</code> classes.  This can be
221*ba8755cbSAndroid Build Coastguard Worker         used to mount a denial of service attack against services
222*ba8755cbSAndroid Build Coastguard Worker         that use Compress' zip package. See the <a
223*ba8755cbSAndroid Build Coastguard Worker         href="security.html">Security Reports</a> page for
224*ba8755cbSAndroid Build Coastguard Worker         details.</li>
225*ba8755cbSAndroid Build Coastguard Worker       </ul>
226*ba8755cbSAndroid Build Coastguard Worker     </section>
227*ba8755cbSAndroid Build Coastguard Worker     <section name="Zstandard">
228*ba8755cbSAndroid Build Coastguard Worker       <ul>
229*ba8755cbSAndroid Build Coastguard Worker         <li>the format requires the otherwise optional <a
230*ba8755cbSAndroid Build Coastguard Worker         href="https://github.com/luben/zstd-jni">Zstandard JNI</a>
231*ba8755cbSAndroid Build Coastguard Worker         library.</li>
232*ba8755cbSAndroid Build Coastguard Worker       </ul>
233*ba8755cbSAndroid Build Coastguard Worker     </section>
234*ba8755cbSAndroid Build Coastguard Worker   </body>
235*ba8755cbSAndroid Build Coastguard Worker</document>
236