Previously, available() would return 0 initially and then negative values once some data head been read. It should be a positive value (for entries with content) initially a decrease as data is read reaching zero once an entry's data has been read in its entirety. This commit initialises the count of the remaining bytes to be equal to the entry's uncompressed size. It also removes logic that closes the stream when remaining equals zero upon read or skip. This condition was not reached before as remaining would become negative as soon as any data was read or skipped. With the correct initialization of remaining, the condition is now reached and it results in test failures due to premature closure. Furthermore, the javadoc of read and skip do not require the stream to be closed when the reach end of file. Closes gh-47056 |
||
---|---|---|
.. | ||
src | ||
build.gradle |