You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2014/07/12 07:46:10 UTC

svn commit: r1609881 - in /commons/proper/compress/trunk/src: main/java/org/apache/commons/compress/compressors/deflate/package.html site/xdoc/examples.xml site/xdoc/index.xml site/xdoc/limitations.xml

Author: bodewig
Date: Sat Jul 12 05:46:09 2014
New Revision: 1609881

URL: http://svn.apache.org/r1609881
Log:
COMPRESS-263 add boilerplate docs for DEFLATE

Added:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/package.html
      - copied, changed from r1609880, commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/lzma/package.html
Modified:
    commons/proper/compress/trunk/src/site/xdoc/examples.xml
    commons/proper/compress/trunk/src/site/xdoc/index.xml
    commons/proper/compress/trunk/src/site/xdoc/limitations.xml

Copied: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/package.html (from r1609880, commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/lzma/package.html)
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/package.html?p2=commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/package.html&p1=commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/lzma/package.html&r1=1609880&r2=1609881&rev=1609881&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/lzma/package.html (original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/package.html Sat Jul 12 05:46:09 2014
@@ -18,16 +18,7 @@
 
 -->
   <body>
-    <p>Provides a stream class decompressing streams using the
-      "stand-alone" LZMA algorithm.</p>
-
-    <p>The class in this package is a wrapper around {@link
-      org.tukaani.xz.LZMAInputStream org.tukaani.xz.LZMAInputStream}
-      and provided by the public
-      domain <a href="http://tukaani.org/xz/java.html">XZ for Java</a>
-      library.</p>
-
-    <p>In general you should prefer the more modern and robust XZ
-      format over stand-alone LZMA compression.</p>
+    <p>Provides a stream classes that allow (de)compressing streams
+      using the DEFLATE algorithm.</p>
   </body>
 </html>

Modified: commons/proper/compress/trunk/src/site/xdoc/examples.xml
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/site/xdoc/examples.xml?rev=1609881&r1=1609880&r2=1609881&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/site/xdoc/examples.xml (original)
+++ commons/proper/compress/trunk/src/site/xdoc/examples.xml Sat Jul 12 05:46:09 2014
@@ -32,9 +32,9 @@
         compressed) archive are archiver formats.</p>
 
         <p>The compressor formats supported are gzip, bzip2, xz, lzma,
-        Pack200a 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>
+        Pack200, DEFLATE 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 lzma, arj,
         dump and Z.  arj can only read uncompressed archives, 7z can read
@@ -481,6 +481,26 @@ lzmaIn.close();
 ]]></source>
       </subsection>
 
+      <subsection name="DEFLATE">
+
+        <p>Uncompressing a given DEFLATE compressed file (you would
+          certainly add exception handling and make sure all streams
+          get closed properly):</p>
+<source><![CDATA[
+FileInputStream fin = new FileInputStream("some-file");
+BufferedInputStream in = new BufferedInputStream(fin);
+FileOutputStream out = new FileOutputStream("archive.tar");
+DeflateCompressorInputStream defIn = new DeflateCompressorInputStream(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="7z">
 
         <p>Note that Commons Compress currently only supports

Modified: commons/proper/compress/trunk/src/site/xdoc/index.xml
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/site/xdoc/index.xml?rev=1609881&r1=1609880&r2=1609881&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/site/xdoc/index.xml (original)
+++ commons/proper/compress/trunk/src/site/xdoc/index.xml Sat Jul 12 05:46:09 2014
@@ -27,7 +27,7 @@
             <p>
                 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 and Z files.
+                bzip2, 7z, arj, lzma, snappy, DEFLATE and Z files.
             </p>
             <p>
                 The code in this component has many origins:
@@ -64,8 +64,11 @@
             <code>CompressorStreamFactory</code> can now autodetect
             the .Z compress format.</p>
           </subsection>
-          <!--subsection name="What's coming in 1.9?">
-          </subsection-->
+          <subsection name="What's coming in 1.9?">
+            <ul>
+              <li>support for raw DEFLATE streams</li>
+            </ul>
+          </subsection>
         </section>
 
         <section name="Documentation">

Modified: commons/proper/compress/trunk/src/site/xdoc/limitations.xml
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/site/xdoc/limitations.xml?rev=1609881&r1=1609880&r2=1609881&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/site/xdoc/limitations.xml (original)
+++ commons/proper/compress/trunk/src/site/xdoc/limitations.xml Sat Jul 12 05:46:09 2014
@@ -77,6 +77,12 @@
      <section name="CPIO">
        <p>We are not aware of any problems.</p>
      </section>
+     <section name="DEFLATE">
+       <ul>
+         <li>CompressorStreamFactory is not able to auto-detect
+         streams using DEFLATE compression.</li>
+       </ul>
+     </section>
      <section name="DUMP">
        <ul>
          <li>read-only support</li>