keiron      01/08/09 23:19:16

  Modified:    src/org/apache/fop/tools TestConverter.java
  Log:
  improves comparison
  should be faster now
  
  Revision  Changes    Path
  1.10      +7 -3      xml-fop/src/org/apache/fop/tools/TestConverter.java
  
  Index: TestConverter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/tools/TestConverter.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TestConverter.java        2001/08/01 23:08:55     1.9
  +++ TestConverter.java        2001/08/10 06:19:16     1.10
  @@ -1,5 +1,5 @@
   /*
  - * $Id: TestConverter.java,v 1.9 2001/08/01 23:08:55 gears Exp $
  + * $Id: TestConverter.java,v 1.10 2001/08/10 06:19:16 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -253,11 +253,15 @@
   
       /**
        * Compare files.
  +     * Returns true if equal.
        */
       protected boolean compareFiles(File f1, File f2) {
  +        if(f1.length() != f2.length()) {
  +            return false;
  +        }
           try {
  -            InputStream is1 = new FileInputStream(f1);
  -            InputStream is2 = new FileInputStream(f2);
  +            InputStream is1 = new BufferedInputStream(new FileInputStream(f1));
  +            InputStream is2 = new BufferedInputStream(new FileInputStream(f2));
               while (true) {
                   int ch1 = is1.read();
                   int ch2 = is2.read();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to