From: Keiron Liddle Date: Fri, 10 Aug 2001 06:19:16 +0000 (+0000) Subject: improves comparison X-Git-Tag: fop-0_20_0~8 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=37263ecb4c6ffd2de2c7c41bd66ae4a5f639cbb8;p=xmlgraphics-fop.git improves comparison should be faster now git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194403 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/org/apache/fop/tools/TestConverter.java b/src/org/apache/fop/tools/TestConverter.java index f7e8c8e42..c02509566 100644 --- a/src/org/apache/fop/tools/TestConverter.java +++ b/src/org/apache/fop/tools/TestConverter.java @@ -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();