I would first check if the lengths are equal, and if not, return false. Then open two FileInputStreams wrapped with BufferedInputStreams, one for each file. Then write a loop that reads one byte from each file, and returns false if the bytes are not equal. Keep looping until one the end of a file is reached. (You already know they're the same length at this point, so
you should reach the end of both files simultaneously.) If you reach the end successfully without returning false, then you can return true instead - all the bytes must be equal.
Note that this technique works equally well regardless of whether you're using text files or binary files. It just tests whether they are
exactly equal, or not.