You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2019/11/26 10:23:41 UTC

[GitHub] [commons-compress] tcurdt commented on a change in pull request #87: COMPRESS-124 : Add support for extracting sparse entries from tar archives

tcurdt commented on a change in pull request #87: COMPRESS-124 : Add support for extracting sparse entries from tar archives
URL: https://github.com/apache/commons-compress/pull/87#discussion_r350653983
 
 

 ##########
 File path: src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
 ##########
 @@ -243,8 +258,16 @@ public long skip(final long n) throws IOException {
             return 0;
         }
 
-        final long available = entrySize - entryOffset;
-        final long skipped = IOUtils.skip(is, Math.min(n, available));
+        long available;
+        long skipped;
+        if(!currEntry.isSparse()) {
 
 Review comment:
   This is creating a lot of duplicate code paths. Maybe the sparse handling could be just moved into get `getRealSize()` and we can keep the single code path?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services