aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/tools
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2001-08-10 06:19:16 +0000
committerKeiron Liddle <keiron@apache.org>2001-08-10 06:19:16 +0000
commit37263ecb4c6ffd2de2c7c41bd66ae4a5f639cbb8 (patch)
tree6ef74edb8c2c12e49256d3776a9e31ae09996fc0 /src/org/apache/fop/tools
parente3d2dff46b79ec4f06cd602cc07ade589dbc7fc3 (diff)
downloadxmlgraphics-fop-37263ecb4c6ffd2de2c7c41bd66ae4a5f639cbb8.tar.gz
xmlgraphics-fop-37263ecb4c6ffd2de2c7c41bd66ae4a5f639cbb8.zip
improves comparison
should be faster now git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194403 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/tools')
-rw-r--r--src/org/apache/fop/tools/TestConverter.java8
1 files changed, 6 insertions, 2 deletions
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();