mirror of
https://github.com/corda/corda.git
synced 2025-01-05 20:54:13 +00:00
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:
parent
d95a8a9626
commit
094af1e794
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user