On 7/8/11 12:55 AM, Weijun Wang wrote:
The diff method is now --
private static void diff(String fname1, String fname2) throws Exception {
if (!Arrays.equals(Files.readAllBytes(new File(fname1).toPath()),
Files.readAllBytes(new File(fname2).toPath()))) {
throw new Exception(
"files " + fname1 + " and " + fname2 + " differ");
}
}
I should learn these new JDK 7 classes more. I guess "new File(f).toPath()" is
the most straight forward way to get a Path object?
I think Paths.get(f) is probably preferable.
Yes, there's a lot of new stuff here in Java 7. I learned all I know about it
from Alan. :-)
s'marks