summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-23 12:46:06 (EDT)
committerEike Stepper2007-07-23 12:46:06 (EDT)
commit749a82103120f0749a3801bfc454bcf954f54ec7 (patch)
treec032548da583b1029aab37f244cfe8c007da7fb1
parent9e41d228d59cc0ef19576da8ed42ba20f5a27494 (diff)
downloadcdo-749a82103120f0749a3801bfc454bcf954f54ec7.zip
cdo-749a82103120f0749a3801bfc454bcf954f54ec7.tar.gz
cdo-749a82103120f0749a3801bfc454bcf954f54ec7.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOUtil.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOUtil.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOUtil.java
index 0e735e2..f8752e2 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOUtil.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOUtil.java
@@ -153,4 +153,30 @@ public final class IOUtil
throw new IORuntimeException(ex);
}
}
+
+ public static boolean equals(InputStream stream1, InputStream stream2) throws IORuntimeException
+ {
+ try
+ {
+ for (;;)
+ {
+ int byte1 = stream1.read();
+ int byte2 = stream2.read();
+
+ if (byte1 != byte2)
+ {
+ return false;
+ }
+
+ if (byte1 == -1)// Implies byte2 == -1
+ {
+ return true;
+ }
+ }
+ }
+ catch (IOException ex)
+ {
+ throw new IORuntimeException(ex);
+ }
+ }
}