commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [2/3] commons-compress git commit: mention LZ4 support coming in 1.14
Date Sat, 04 Feb 2017 13:52:06 GMT
mention LZ4 support coming in 1.14


Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/6497dcf3
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/6497dcf3
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/6497dcf3

Branch: refs/heads/master
Commit: 6497dcf3319914fb457178bb32671f6238f1a7f5
Parents: 906d212
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Sat Feb 4 14:46:18 2017 +0100
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Sat Feb 4 14:46:18 2017 +0100

----------------------------------------------------------------------
 src/site/xdoc/examples.xml | 28 ++++++++++++++++++++++++++++
 src/site/xdoc/index.xml    |  3 ++-
 2 files changed, 30 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/6497dcf3/src/site/xdoc/examples.xml
----------------------------------------------------------------------
diff --git a/src/site/xdoc/examples.xml b/src/site/xdoc/examples.xml
index ec6a130..79e8cf9 100644
--- a/src/site/xdoc/examples.xml
+++ b/src/site/xdoc/examples.xml
@@ -682,6 +682,34 @@ zIn.close();
 
       </subsection>
 
+      <subsection name="LZ4">
+
+        <p>There are two different "formats" used for <a
+        href="http://lz4.github.io/lz4/">lz4</a>. The format called
+        "block format" only contains the raw compressed data while the
+        other provides a higher level "frame format" - Commons
+        Compress offers two different stream classes for reading or
+        writing either format.</p>
+
+        <p>Uncompressing a given frame LZ4 file (you would
+          certainly add exception handling and make sure all streams
+          get closed properly):</p>
+<source><![CDATA[
+FileInputStream fin = new FileInputStream("archive.tar.sz");
+BufferedInputStream in = new BufferedInputStream(fin);
+FileOutputStream out = new FileOutputStream("archive.tar");
+FramedLZ4CompressorInputStream zIn = new FramedLZ4CompressorInputStream(in);
+final byte[] buffer = new byte[buffersize];
+int n = 0;
+while (-1 != (n = zIn.read(buffer))) {
+    out.write(buffer, 0, n);
+}
+out.close();
+zIn.close();
+]]></source>
+
+      </subsection>
+
     <subsection name="Extending Commons Compress">
     
         <p>

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/6497dcf3/src/site/xdoc/index.xml
----------------------------------------------------------------------
diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml
index 60c0184..df42b69 100644
--- a/src/site/xdoc/index.xml
+++ b/src/site/xdoc/index.xml
@@ -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, DEFLATE and Z files.
+                bzip2, 7z, arj, lzma, snappy, DEFLATE, lz4 and Z files.
             </p>
             <p>
                 The code in this component has many origins:
@@ -60,6 +60,7 @@
           <subsection name="What's coming in 1.14?">
             <ul>
               <li>Added support for writing the Snappy format</li>
+              <li>Added support for the LZ4 compression format</li>
             </ul>
           </subsection>
           <subsection name="What's new in 1.13?">


Mime
View raw message