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/10 09:10:17 UTC
[1/2] commons-compress git commit: COMPRESS-380 lost Christian's name
during merge
Repository: commons-compress
Updated Branches:
refs/heads/master 0504d0bfe -> 135dd48fd
COMPRESS-380 lost Christian's name during merge
Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/6ef3fd45
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/6ef3fd45
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/6ef3fd45
Branch: refs/heads/master
Commit: 6ef3fd45083c60dd35fcd0e61bd417530740aa45
Parents: 0504d0b
Author: Stefan Bodewig <bo...@apache.org>
Authored: Wed Jan 10 10:05:36 2018 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Wed Jan 10 10:05:36 2018 +0100
----------------------------------------------------------------------
src/changes/changes.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-compress/blob/6ef3fd45/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index de50417..b149482 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -81,7 +81,7 @@ The <action> type attribute can be add,update,fix,remove.
ZipArchiveEntry now exposes how the name or comment have been
determined when the entry was read.
<action issue="COMPRESS-380" type="add" date="2018-01-09"
- due-to="">
+ due-to="Christian Marquez Grabia">
Added read-only DEFLATE64 support to ZIP archives and as
stand-alone CompressorInputStream.
</action>
[2/2] commons-compress git commit: COMPRESS-438 buffer bounded
streams in ZipFile for better performance
Posted by bo...@apache.org.
COMPRESS-438 buffer bounded streams in ZipFile for better performance
Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/135dd48f
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/135dd48f
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/135dd48f
Branch: refs/heads/master
Commit: 135dd48fda61f81d9b8e0aec0661c1d48226ae3c
Parents: 6ef3fd4
Author: Stefan Bodewig <bo...@apache.org>
Authored: Wed Jan 10 10:09:17 2018 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Wed Jan 10 10:09:17 2018 +0100
----------------------------------------------------------------------
src/changes/changes.xml | 4 ++++
.../commons/compress/archivers/zip/ZipFile.java | 16 ++++++++++------
2 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-compress/blob/135dd48f/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index b149482..5c3b44d 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -85,6 +85,10 @@ The <action> type attribute can be add,update,fix,remove.
Added read-only DEFLATE64 support to ZIP archives and as
stand-alone CompressorInputStream.
</action>
+ <action issue="COMPRESS-438" type="add" date="2018-01-10">
+ ZipFile.getInputStream will now always buffer the stream
+ internally in order to improve read performance.
+ </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/135dd48f/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
index 02ec7dd..f9fe41b 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
@@ -477,21 +477,25 @@ public class ZipFile implements Closeable {
// cast valididty is checked just above
ZipUtil.checkRequestedFeatures(ze);
final long start = ze.getDataOffset();
- // doesn't get closed if the method is not supported, but doesn't hold any resources either
+
+ // doesn't get closed if the method is not supported - which
+ // should never happen because of the checkRequestedFeatures
+ // call above
final BoundedInputStream bis =
createBoundedInputStream(start, ze.getCompressedSize()); //NOSONAR
+ final InputStream buf = new BufferedInputStream(bis); //NOSONAR
switch (ZipMethod.getMethodByCode(ze.getMethod())) {
case STORED:
return bis;
case UNSHRINKING:
- return new UnshrinkingInputStream(bis);
+ return new UnshrinkingInputStream(buf);
case IMPLODING:
return new ExplodingInputStream(ze.getGeneralPurposeBit().getSlidingDictionarySize(),
- ze.getGeneralPurposeBit().getNumberOfShannonFanoTrees(), new BufferedInputStream(bis));
+ ze.getGeneralPurposeBit().getNumberOfShannonFanoTrees(), buf);
case DEFLATED:
bis.addDummy();
final Inflater inflater = new Inflater(true);
- return new InflaterInputStream(bis, inflater) {
+ return new InflaterInputStream(buf, inflater) {
@Override
public void close() throws IOException {
try {
@@ -502,9 +506,9 @@ public class ZipFile implements Closeable {
}
};
case BZIP2:
- return new BZip2CompressorInputStream(bis);
+ return new BZip2CompressorInputStream(buf);
case ENHANCED_DEFLATED:
- return new Deflate64CompressorInputStream(bis);
+ return new Deflate64CompressorInputStream(buf);
case AES_ENCRYPTED:
case EXPANDING_LEVEL_1:
case EXPANDING_LEVEL_2: