contentEquals

public static boolean contentEquals(Path first, Path second, BooleanSupplier cancellationRequested, String cancellationMessage)

Byte-for-byte file comparison with a size short-circuit, polling for cancellation between reads.