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 2018/01/28 11:36:42 UTC
commons-compress git commit: COMPRESS-434 improve docs on
decompressConcatenated
Repository: commons-compress
Updated Branches:
refs/heads/master 237b7e3d8 -> 04f887002
COMPRESS-434 improve docs on decompressConcatenated
Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/04f88700
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/04f88700
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/04f88700
Branch: refs/heads/master
Commit: 04f887002eb2c99ef3e86f2c967df91e2d4dfdfe
Parents: 237b7e3
Author: Stefan Bodewig <bo...@apache.org>
Authored: Sun Jan 28 12:35:44 2018 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Sun Jan 28 12:36:23 2018 +0100
----------------------------------------------------------------------
.../gzip/GzipCompressorInputStream.java | 25 ++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-compress/blob/04f88700/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java
index bbf40ee..a406499 100644
--- a/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java
@@ -36,18 +36,39 @@ import org.apache.commons.compress.utils.CharsetNames;
/**
* Input stream that decompresses .gz files.
- * This supports decompressing concatenated .gz files which is important
- * when decompressing standalone .gz files.
+ *
+ * <p>This supports decompressing concatenated .gz files which is important
+ * when decompressing standalone .gz files.</p>
+ *
* <p>
* {@link java.util.zip.GZIPInputStream} doesn't decompress concatenated .gz
* files: it stops after the first member and silently ignores the rest.
* It doesn't leave the read position to point to the beginning of the next
* member, which makes it difficult workaround the lack of concatenation
* support.
+ * </p>
+ *
* <p>
* Instead of using <code>GZIPInputStream</code>, this class has its own .gz
* container format decoder. The actual decompression is done with
* {@link java.util.zip.Inflater}.
+ * </p>
+ *
+ * <p>If you use the constructor {@code GzipCompressorInputStream(in)}
+ * or {@code GzipCompressorInputStream(in, false)} with some {@code
+ * InputStream} {@code in} then {@link #read} will return -1 as soon
+ * as the first internal member has been read completely. The stream
+ * {@code in} will be positioned at the start of the second gzip
+ * member if there is one.</p>
+ *
+ * <p>If you use the constructor {@code GzipCompressorInputStream(in,
+ * true)} with some {@code InputStream} {@code in} then {@link #read}
+ * will return -1 once the stream {@code in} has been exhausted. The
+ * data read from a stream constructed this way will consist of the
+ * concatenated data of all gzip members contained inside {@code
+ * in}.</p>
+ *
+ * @see "https://tools.ietf.org/html/rfc1952"
*/
public class GzipCompressorInputStream extends CompressorInputStream {
// Header flags