/[classpath]/classpath/java/util/zip/ZipInputStream.java
ViewVC logotype

Diff of /classpath/java/util/zip/ZipInputStream.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by tromey, Mon Jun 3 22:51:34 2002 UTC revision 1.7 by tromey, Wed Sep 25 21:06:16 2002 UTC
# Line 61  public class ZipInputStream extends Infl Line 61  public class ZipInputStream extends Infl
61    private int method;    private int method;
62    private int flags;    private int flags;
63    private int avail;    private int avail;
64      private boolean entryAtEOF;
65    
66    /**    /**
67     * Creates a new Zip input stream, reading a zip archive.     * Creates a new Zip input stream, reading a zip archive.
# Line 150  public class ZipInputStream extends Infl Line 151  public class ZipInputStream extends Infl
151          return null;          return null;
152        }        }
153      if (header != LOCSIG)      if (header != LOCSIG)
154        throw new ZipException("Wrong Local header signature" + Integer.toHexString(header));        throw new ZipException("Wrong Local header signature"
155                                 + Integer.toHexString(header));
156      /* skip version */      /* skip version */
157      readLeShort();      readLeShort();
158      flags = readLeShort();      flags = readLeShort();
# Line 171  public class ZipInputStream extends Infl Line 173  public class ZipInputStream extends Infl
173      String name = new String(buffer);      String name = new String(buffer);
174            
175      entry = createZipEntry(name);      entry = createZipEntry(name);
176        entryAtEOF = false;
177      entry.setMethod(method);      entry.setMethod(method);
178      if ((flags & 8) == 0)      if ((flags & 8) == 0)
179        {        {
# Line 252  public class ZipInputStream extends Infl Line 255  public class ZipInputStream extends Infl
255      if (method == ZipOutputStream.DEFLATED)      if (method == ZipOutputStream.DEFLATED)
256        inf.reset();        inf.reset();
257      entry = null;      entry = null;
258        entryAtEOF = true;
259    }    }
260    
261    public int available() throws IOException    public int available() throws IOException
262    {    {
263      return entry != null ? 1 : 0;      return entryAtEOF ? 0 : 1;
264    }    }
265    
266    /**    /**
# Line 335  public class ZipInputStream extends Infl Line 339  public class ZipInputStream extends Infl
339            throw new ZipException("CRC mismatch");            throw new ZipException("CRC mismatch");
340          crc.reset();          crc.reset();
341          entry = null;          entry = null;
342            entryAtEOF = true;
343        }        }
344      return len;      return len;
345    }    }
# Line 348  public class ZipInputStream extends Infl Line 353  public class ZipInputStream extends Infl
353      super.close();      super.close();
354      crc = null;      crc = null;
355      entry = null;      entry = null;
356        entryAtEOF = true;
357    }    }
358    
359    /**    /**

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26