Java: How to check that 2 binary files are same?

前端 未结 7 1307
旧时难觅i
旧时难觅i 2021-02-07 17:27

What is the easiest way to check (in a unit test) whether binary files A and B are equal?

7条回答
  •  情话喂你
    2021-02-07 18:16

    With assertBinaryEquals.

    public static void assertBinaryEquals(java.io.File expected, java.io.File actual)

    http://junit-addons.sourceforge.net/junitx/framework/FileAssert.html

提交回复
热议问题