home *** CD-ROM | disk | FTP | other *** search
- package java.util.zip;
-
- import java.io.IOException;
- import java.io.InputStream;
-
- class ZipFile$ZipFileInputStream extends InputStream {
- private long jzfile;
- private long jzentry;
- private int pos;
- private int rem;
- private int size;
-
- ZipFile$ZipFileInputStream(long var1, long var3) {
- this.jzfile = var1;
- this.jzentry = var3;
- this.pos = 0;
- this.rem = ZipFile.access$500(var3);
- this.size = ZipFile.access$600(var3);
- }
-
- public int read(byte[] var1, int var2, int var3) throws IOException {
- if (this.rem == 0) {
- return -1;
- } else if (var3 <= 0) {
- return 0;
- } else {
- if (var3 > this.rem) {
- var3 = this.rem;
- }
-
- var3 = ZipFile.access$700(this.jzfile, this.jzentry, this.pos, var1, var2, var3);
- if (var3 > 0) {
- this.pos += var3;
- this.rem -= var3;
- }
-
- if (this.rem == 0) {
- this.cleanup();
- }
-
- return var3;
- }
- }
-
- public int read() throws IOException {
- byte[] var1 = new byte[1];
- return this.read(var1, 0, 1) == 1 ? var1[0] & 255 : -1;
- }
-
- public long skip(long var1) {
- int var3 = var1 > (long)this.rem ? this.rem : (int)var1;
- this.pos += var3;
- this.rem -= var3;
- if (this.rem == 0) {
- this.cleanup();
- }
-
- return (long)var3;
- }
-
- public int available() {
- return this.size;
- }
-
- private void cleanup() {
- this.rem = 0;
- if (this.jzentry != 0L) {
- ZipFile.access$400(this.jzfile, this.jzentry);
- this.jzentry = 0L;
- }
-
- }
-
- public void close() {
- this.cleanup();
- }
- }
-