On Sep 19, 2018, at 5:59 PM, Joe Wang <huizhe.w...@oracle.com> wrote:

> I'll do some performance testing for both cases, FileChannel/direct buffer 
> and possible checksum comparison, although, as you said, the later might not 
> work since we need to be 100%. The probability of false positives is likely 
> extremely low, but is not zero after all. I'll do the performance check any 
> ways just out of curiosity. But in many cases, checksum comparison may not be 
> faster than direct comparison, esp. in this case the API compares just two 
> files. Checksum values would be nice if there are multiple files to compare.

I doubt the checksum test is worthwhile. It might be useful however to try 
FileChannel and direct byte buffers combined with ByteBuffer.mismatch() [1].

Thanks,

Brian

[1] 
https://download.java.net/java/early_access/jdk12/docs/api/java.base/java/nio/ByteBuffer.html#mismatch(java.nio.ByteBuffer)

Reply via email to