ZipFile speed improvement patch

Tom Tromey tromey@redhat.com
Thu Oct 31 10:30:00 GMT 2002


>>>>> "Mark" == Mark Wielaard <mark@klomp.org> writes:

Mark> 2002-10-27  Mark Wielaard  <mark@klomp.org>
Mark>   * java/util/zip/ZipFile.java (readLeShort): Take and use DataInput as
Mark>   argument.
Mark>   (readLeShort): Likewise and use byte[].
Mark>   (readLeInt): Likewise.
Mark>   (readEntries): Use new versions of methods and use byte[] for reading
Mark>   a complete zip entry. Add ZipFile name to exceptions.
Mark>   (entries): Add ZipFile name to exceptions.
Mark>   (getEntry): Likewise.
Mark>   (checkLocalHeader): Use new versions of methods and add ZipFile name
Mark>   to exceptions.

Mark> OK to commit?

Yes.

Mark> -  private final int readLeShort() throws IOException {
Mark> -    return raf.readUnsignedByte() | raf.readUnsignedByte() << 8;
Mark> +  private final int readLeShort(DataInput di) throws IOException {
Mark> +    byte[] b = new byte[2];

This would be a good opportunity to fix a couple indentation bugs
here.  readLeInt also has the brace in the wrong place.

Tom



More information about the Java-patches mailing list