summaryrefslogtreecommitdiff
path: root/java/util/zip/ZipFile.java
diff options
context:
space:
mode:
authorLillian Angel <langel@redhat.com>2006-04-04 14:05:20 +0000
committerLillian Angel <langel@redhat.com>2006-04-04 14:05:20 +0000
commitc4537ae04ec0aef96dd400ab7fea73b5f030e035 (patch)
treec373d6838aa7b2d22e8304bc05fe47f080b9d3d8 /java/util/zip/ZipFile.java
parent1cbb41eec5734b5542083177cc66984ce7710967 (diff)
downloadclasspath-c4537ae04ec0aef96dd400ab7fea73b5f030e035.tar.gz
2006-04-04 Lillian Angel <langel@redhat.com>
* java/util/zip/ZipFile.java (getInputStream): Fixed to return size of ZipEntry minus the total bytes read. This guarantees that the right value is returned even if some bytes have already been read.
Diffstat (limited to 'java/util/zip/ZipFile.java')
-rw-r--r--java/util/zip/ZipFile.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/java/util/zip/ZipFile.java b/java/util/zip/ZipFile.java
index 06edcb524..4e9c49560 100644
--- a/java/util/zip/ZipFile.java
+++ b/java/util/zip/ZipFile.java
@@ -445,13 +445,14 @@ public class ZipFile implements ZipConstants
case ZipOutputStream.STORED:
return inp;
case ZipOutputStream.DEFLATED:
+ final Inflater inf = new Inflater(true);
final int sz = (int) entry.getSize();
- return new InflaterInputStream(inp, new Inflater(true))
+ return new InflaterInputStream(inp, inf)
{
public int available() throws IOException
{
if (super.available() != 0)
- return sz;
+ return sz - inf.getTotalOut();
return 0;
}
};