]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
improves comparison
authorKeiron Liddle <keiron@apache.org>
Fri, 10 Aug 2001 06:19:16 +0000 (06:19 +0000)
committerKeiron Liddle <keiron@apache.org>
Fri, 10 Aug 2001 06:19:16 +0000 (06:19 +0000)
should be faster now

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194403 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/tools/TestConverter.java

index f7e8c8e42d9fa7a6e12736d62875e402e56aaa4d..c02509566140ce3ea357a981030923f33c3a60b9 100644 (file)
@@ -253,11 +253,15 @@ public class TestConverter {
 
     /**
      * 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();