Finds and returns the position of the first mismatched byte in the content of two files, or
-1L if there is no mismatch. The position will be in the inclusive range of
0L up to the size (in bytes) of the smaller file.
Two files are considered to match if they satisfy one of the following conditions:
The two paths locate the same file , even if two equal paths locate a file does not exist, or
The two files are the same size, and every byte in the first file is identical to the corresponding byte in the second file.
Otherwise there is a mismatch between the two files and the value returned by this method is:
The position of the first mismatched byte, or
The size of the smaller file (in bytes) when the files are different sizes and every byte of the smaller file is identical to the corresponding byte of the larger file.
This method may not be atomic with respect to other file system operations. This method is always reflexive (for
Path f ,
-1L). If the file system and files remain static, then this method is symmetric (for two
Paths f and
mismatch(f,g) will return the same value as