dweiss commented on code in PR #306:
URL: https://github.com/apache/commons-compress/pull/306#discussion_r944327197
##########
src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java:
##########
@@ -638,13 +646,11 @@ public InputStream getInputStream(final ZipArchiveEntry
ze)
}
// cast validity is checked just above
ZipUtil.checkRequestedFeatures(ze);
- final long start = getDataOffset(ze);
// doesn't get closed if the method is not supported - which
// should never happen because of the checkRequestedFeatures
// call above
- final InputStream is =
- new BufferedInputStream(createBoundedInputStream(start,
ze.getCompressedSize())); //NOSONAR
+ final InputStream is = new BufferedInputStream(getRawInputStream(ze));
//NOSONAR
switch (ZipMethod.getMethodByCode(ze.getMethod())) {
Review Comment:
This replaces duplicate code with just requesting a raw compressed stream,
which should be always available.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]