diff options
| author | Lillian Angel <langel@redhat.com> | 2006-04-03 20:50:37 +0000 |
|---|---|---|
| committer | Lillian Angel <langel@redhat.com> | 2006-04-03 20:50:37 +0000 |
| commit | e0b03ae33c44a793116e95b133f7cc44554131b2 (patch) | |
| tree | 5b45e56eece8cb151f408a688266ab419016abd5 /java/util/zip/ZipFile.java | |
| parent | 2a8df925bcd276fa213b64d1fca0cf4a52c4040d (diff) | |
| download | classpath-e0b03ae33c44a793116e95b133f7cc44554131b2.tar.gz | |
2006-04-03 Lillian Angel <langel@redhat.com>
PR classpath/24596 and PR classpath/26930
* java/util/zip/ZipFile.java
(getInputStream): Override available function for
InflaterInputStream instance.
Diffstat (limited to 'java/util/zip/ZipFile.java')
| -rw-r--r-- | java/util/zip/ZipFile.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/java/util/zip/ZipFile.java b/java/util/zip/ZipFile.java index 5c0fe17d6..06edcb524 100644 --- a/java/util/zip/ZipFile.java +++ b/java/util/zip/ZipFile.java @@ -445,7 +445,16 @@ public class ZipFile implements ZipConstants case ZipOutputStream.STORED: return inp; case ZipOutputStream.DEFLATED: - return new InflaterInputStream(inp, new Inflater(true)); + final int sz = (int) entry.getSize(); + return new InflaterInputStream(inp, new Inflater(true)) + { + public int available() throws IOException + { + if (super.available() != 0) + return sz; + return 0; + } + }; default: throw new ZipException("Unknown compression method " + method); } @@ -551,6 +560,7 @@ public class ZipFile implements ZipConstants pos = 0; fillBuffer(); } + return buffer[pos++] & 0xFF; } @@ -581,7 +591,7 @@ public class ZipFile implements ZipConstants len -= remain; totalBytesRead += remain; } - + return totalBytesRead; } |
