/[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.18 by mkoch, Thu Oct 21 21:07:15 2004 UTC revision 1.19 by mkoch, Fri Oct 22 18:02:06 2004 UTC
# Line 148  public class ZipFile implements ZipConst Line 148  public class ZipFile implements ZipConst
148     * @exception IOException if a i/o error occured.     * @exception IOException if a i/o error occured.
149     * @exception EOFException if the file ends prematurely     * @exception EOFException if the file ends prematurely
150     */     */
151    private final int readLeShort(DataInput di, byte[] b) throws IOException    private int readLeShort(DataInput di, byte[] b) throws IOException
152    {    {
153      di.readFully(b, 0, 2);      di.readFully(b, 0, 2);
154      return (b[0] & 0xff) | (b[1] & 0xff) << 8;      return (b[0] & 0xff) | (b[1] & 0xff) << 8;
# Line 165  public class ZipFile implements ZipConst Line 165  public class ZipFile implements ZipConst
165     * @exception IOException if a i/o error occured.     * @exception IOException if a i/o error occured.
166     * @exception EOFException if the file ends prematurely     * @exception EOFException if the file ends prematurely
167     */     */
168    private final int readLeInt(DataInput di, byte[] b) throws IOException    private int readLeInt(DataInput di, byte[] b) throws IOException
169    {    {
170      di.readFully(b, 0, 4);      di.readFully(b, 0, 4);
171      return ((b[0] & 0xff) | (b[1] & 0xff) << 8)      return ((b[0] & 0xff) | (b[1] & 0xff) << 8)
172              | ((b[2] & 0xff) | (b[3] & 0xff) << 8) << 16;              | ((b[2] & 0xff) | (b[3] & 0xff) << 8) << 16;
173    }    }
174    
     
175    /**    /**
176     * Read an unsigned short in little endian byte order from the given     * Read an unsigned short in little endian byte order from the given
177     * byte buffer at the given offset.     * byte buffer at the given offset.
# Line 181  public class ZipFile implements ZipConst Line 180  public class ZipFile implements ZipConst
180     * @param off the offset to read from.     * @param off the offset to read from.
181     * @return The value read.     * @return The value read.
182     */     */
183    private final int readLeShort(byte[] b, int off)    private int readLeShort(byte[] b, int off)
184    {    {
185      return (b[off] & 0xff) | (b[off+1] & 0xff) << 8;      return (b[off] & 0xff) | (b[off+1] & 0xff) << 8;
186    }    }
# Line 194  public class ZipFile implements ZipConst Line 193  public class ZipFile implements ZipConst
193     * @param off the offset to read from.     * @param off the offset to read from.
194     * @return The value read.     * @return The value read.
195     */     */
196    private final int readLeInt(byte[] b, int off)    private int readLeInt(byte[] b, int off)
197    {    {
198      return ((b[off] & 0xff) | (b[off+1] & 0xff) << 8)      return ((b[off] & 0xff) | (b[off+1] & 0xff) << 8)
199              | ((b[off+2] & 0xff) | (b[off+3] & 0xff) << 8) << 16;              | ((b[off+2] & 0xff) | (b[off+3] & 0xff) << 8) << 16;

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

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