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

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

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

revision 1.26 by tromey, Tue Sep 13 22:19:15 2005 UTC revision 1.27 by green, Fri Sep 16 01:07:21 2005 UTC
# Line 144  public class ZipFile implements ZipConst Line 144  public class ZipFile implements ZipConst
144    private void checkZipFile() throws IOException, ZipException    private void checkZipFile() throws IOException, ZipException
145    {    {
146      byte[] magicBuf = new byte[4];      byte[] magicBuf = new byte[4];
147      raf.read(magicBuf);      boolean validRead = true;
148    
149      if (readLeInt(magicBuf, 0) != LOCSIG)      try
150          {
151            raf.readFully(magicBuf);
152          }
153        catch (EOFException eof)
154          {
155            validRead = false;
156          }
157    
158        if (validRead == false || readLeInt(magicBuf, 0) != LOCSIG)
159        {        {
160          raf.close();          raf.close();
161          throw new ZipException("Not a valid zip file");          throw new ZipException("Not a valid zip file");

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

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