remove redundant decrement in ZipFile.getInputStream inner class

We were decrementing the "remaining" field twice for each byte read
using the no-arg read method, which resulted in available() returning
a value that was too small.
This commit is contained in:
Joel Dice 2014-02-26 14:24:18 -07:00
parent d95a8a9626
commit 094af1e794

View File

@ -103,11 +103,9 @@ public class ZipFile {
int remaining = uncompressedSize(window, pointer);
public int read() throws IOException {
int c = super.read();
if (c >= 0) {
-- remaining;
}
return c;
byte[] buffer = new byte[1];
int c = read(buffer);
return (c < 0 ? c : (buffer[0] & 0xFF));
}
public int read(byte[] buffer) throws IOException {