Ignore:
Timestamp:
Apr 27, 2004, 8:39:34 PM (22 years ago)
Author:
bird
Message:

GCC v3.3.3 sources.

Location:
branches/GNU/src/gcc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/gcc

    • Property svn:ignore
      •  

        old new  
        2626configure.vr
        2727configure.vrs
         28
        2829Makefile
        29 dir.info
        3030lost+found
        3131update.out
  • branches/GNU/src/gcc/libjava/java/util/zip/GZIPInputStream.java

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    11/* GZIPInputStream.java - Input filter for reading gzip file
    2    Copyright (C) 1999, 2000 Free Software Foundation, Inc.
     2   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
    33
    44This file is part of GNU Classpath.
     
    142142      {
    143143        eos = true;
    144         int header_crc = read4 ();
     144
     145        byte[] tmp = new byte[8];
     146        // First copy remaining bytes from inflater input buffer.
     147        int avail = inf.getRemaining ();
     148        System.arraycopy (this.buf, this.len - avail, tmp, 0, avail);
     149
     150        // Now read remaining bytes from wrapped input stream.
     151        for (int i = avail; i < 8; ++i)
     152          {
     153            tmp[i] = (byte) eof_read ();
     154          }
     155
     156        int header_crc = read4 (tmp, 0);
    145157        if (crc.getValue() != header_crc)
    146           throw new ZipException ("corrupted gzip file");
    147         // Read final `ISIZE' field.
    148         // FIXME: should we check this length?
    149         read4 ();
     158          throw new ZipException ("corrupted gzip file");
     159       
     160       
     161        );
    150162        return -1;
    151163      }
     
    154166  }
    155167
    156   private final int read4 () throws IOException
     168  private final int read4 () throws IOException
    157169  {
    158     int byte0 = in.read();
    159     int byte1 = in.read();
    160     int byte2 = in.read();
    161     int byte3 = in.read();
    162     if (byte3 < 0)
    163       throw new ZipException (".zip archive ended prematurely");
    164     return ((byte3 & 0xFF) << 24) + ((byte2 & 0xFF) << 16)
    165       + ((byte1 & 0xFF) << 8) + (byte0 & 0xFF);
     170    return (((buf[offset + 3] & 0xFF) << 24) + ((buf[offset + 2] & 0xFF) << 16)
     171            + ((buf[offset + 1] & 0xFF) << 8) + (buf[offset] & 0xFF));
    166172  }
    167173
Note: See TracChangeset for help on using the changeset viewer.