mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +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);
|
int remaining = uncompressedSize(window, pointer);
|
||||||
|
|
||||||
public int read() throws IOException {
|
public int read() throws IOException {
|
||||||
int c = super.read();
|
byte[] buffer = new byte[1];
|
||||||
if (c >= 0) {
|
int c = read(buffer);
|
||||||
-- remaining;
|
return (c < 0 ? c : (buffer[0] & 0xFF));
|
||||||
}
|
|
||||||
return c;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int read(byte[] buffer) throws IOException {
|
public int read(byte[] buffer) throws IOException {
|
||||||
|
Loading…
Reference in New Issue
Block a user