Replace call to unix 'cmp' command with Java function