diff options
author | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-08-20 21:51:19 +0000 |
---|---|---|
committer | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-08-20 21:51:19 +0000 |
commit | 1345d413d346050f6ad599c2106abc15e541f4fb (patch) | |
tree | f8b19485e6bf07c2c6401e9250d3f27bdbc43fd8 /libjava/java/util/zip/ZipInputStream.java | |
parent | bad6bf53a0651af433617614f4967c4d0284dee2 (diff) | |
download | ppe42-gcc-1345d413d346050f6ad599c2106abc15e541f4fb.tar.gz ppe42-gcc-1345d413d346050f6ad599c2106abc15e541f4fb.zip |
2000-08-20 Mark Wielaard <mark@klomp.org>
* java/util/zip/Adler32.java: Make private variables really private
* java/util/zip/CRC32.java: Make private variables really private
* java/util/zip/CheckedInputStream.java: skip() could skip to much bytes
* java/util/zip/InflaterInputStream.java: skip() could skip to much bytes
* java/util/zip/ZipEntry.java: setCompressedSize() didn't check input
* java/util/zip/ZipFile.java: size() new 1.2 method
* java/util/zip/ZipInputStream.java: Use createZipEntry not new ZipEntry.
since 1.2 available() always returns just 1 or 0 when closed
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35826 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/util/zip/ZipInputStream.java')
-rw-r--r-- | libjava/java/util/zip/ZipInputStream.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libjava/java/util/zip/ZipInputStream.java b/libjava/java/util/zip/ZipInputStream.java index a147b228a69..79efb59f06c 100644 --- a/libjava/java/util/zip/ZipInputStream.java +++ b/libjava/java/util/zip/ZipInputStream.java @@ -89,7 +89,7 @@ public class ZipInputStream extends InflaterInputStream implements ZipConstants int extraLength = readu2(); byte[] bname = new byte[filenameLength]; readFully(bname); - ZipEntry entry = new ZipEntry(new String(bname, "8859_1")); + ZipEntry entry = createZipEntry(new String(bname, "8859_1")); if (extraLength > 0) { byte[] bextra = new byte[extraLength]; @@ -160,6 +160,13 @@ public class ZipInputStream extends InflaterInputStream implements ZipConstants return count; } + public int available() { + if (closed) + return 0; + else + return 1; + } + private void readFully (byte[] b) throws IOException { int off = 0; @@ -222,6 +229,7 @@ public class ZipInputStream extends InflaterInputStream implements ZipConstants public void close () throws IOException { current = null; + closed = true; super.close(); } @@ -231,4 +239,6 @@ public class ZipInputStream extends InflaterInputStream implements ZipConstants private int avail; // Number of bytes we can read from underlying stream. private int compressed_bytes; + // Is this ZipInputStream closed? Set by the close() method. + private boolean closed = false; } |