commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebbASF <...@git.apache.org>
Subject [GitHub] commons-compress pull request #21: COMPRESS-388: Fix concurrent reads perfor...
Date Sun, 23 Apr 2017 16:13:33 GMT
Github user sebbASF commented on a diff in the pull request:

    https://github.com/apache/commons-compress/pull/21#discussion_r112838358
  
    --- Diff: src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java ---
    @@ -1081,16 +1082,26 @@ private boolean startsWithLocalFileHeader() throws IOException
{
         }
     
         /**
    +     * Creates new BoundedInputStream, according to implementation of
    +     * underlying archive channel.
    +     */
    +    private BoundedInputStream createBoundedInputStream(long start, long remaining) {
    +        return archive instanceof FileChannel ?
    +            new BoundedFileChannelInputStream(start, remaining) :
    +            new BoundedInputStream(start, remaining);
    +    }
    +
    +    /**
          * InputStream that delegates requests to the underlying
          * SeekableByteChannel, making sure that only bytes from a certain
          * range can be read.
          */
         private class BoundedInputStream extends InputStream {
    -        private static final int MAX_BUF_LEN = 8192;
    -        private final ByteBuffer buffer;
    -        private long remaining;
    -        private long loc;
    -        private boolean addDummyByte = false;
    +        protected static final int MAX_BUF_LEN = 8192;
    +        protected final ByteBuffer buffer;
    +        protected long remaining;
    +        protected long loc;
    +        protected boolean addDummyByte = false;
     
    --- End diff --
    
    Do these really need to be protected rather than private or package-protected?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message