< prev index next >

src/java.base/share/classes/java/util/zip/ZipFile.java

Print this page

        

*** 689,699 **** /* * Inner class implementing the input stream used to read a * (possibly compressed) zip file entry. */ private class ZipFileInputStream extends InputStream { ! private volatile boolean closeRequested = false; protected long jzentry; // address of jzentry data private long pos; // current position within entry data protected long rem; // number of remaining bytes within entry protected long size; // uncompressed size of this entry --- 689,699 ---- /* * Inner class implementing the input stream used to read a * (possibly compressed) zip file entry. */ private class ZipFileInputStream extends InputStream { ! private volatile boolean zfisCloseRequested = false; protected long jzentry; // address of jzentry data private long pos; // current position within entry data protected long rem; // number of remaining bytes within entry protected long size; // uncompressed size of this entry
*** 716,725 **** --- 716,726 ---- } if (len > rem) { len = (int) rem; } + // Check if ZipFile open ensureOpenOrZipException(); len = ZipFile.read(ZipFile.this.jzfile, jzentry, pos, b, off, len); if (len > 0) { this.pos = (pos + len);
*** 759,771 **** public long size() { return size; } public void close() { ! if (closeRequested) return; ! closeRequested = true; rem = 0; synchronized (ZipFile.this) { if (jzentry != 0 && ZipFile.this.jzfile != 0) { freeEntry(ZipFile.this.jzfile, jzentry); --- 760,772 ---- public long size() { return size; } public void close() { ! if (zfisCloseRequested) return; ! zfisCloseRequested = true; rem = 0; synchronized (ZipFile.this) { if (jzentry != 0 && ZipFile.this.jzfile != 0) { freeEntry(ZipFile.this.jzfile, jzentry);
< prev index next >