akbertram opened a new pull request #74: Removed incorrect use of InputStream.available() in ArArchiveInputStream URL: https://github.com/apache/commons-compress/pull/74 The deleted code appears to be checking for a premature end-of-file using the InputStream.available() method. This however, misunderstands the InputStream API. The available() method only returns an estimate, and cannot be used to check for the remaining bytes in the file. From the documentation: > Returns an estimate of the number of bytes that can be read (or > skipped over) from this input stream without blocking by the next > invocation of a method for this input stream. The next invocation > might be the same thread or another thread. A single read or skip of this > many bytes will not block, but may read or skip fewer bytes. > > Note that while some implementations of {@code InputStream} will return > the total number of bytes in the stream, many will not. It is > never correct to use the return value of this method to allocate > a buffer intended to hold all data in this stream.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
