Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VCDIFF for Java or alternative binary diff formats [closed]

Is there an open-source Java implementation of the VCDIFF binary diff format (decoder and encoder)?

There are xdelta and open-vcdiff, but those are both C libraries.

Alternatively, are the other formats/algorithms that one could use to generate diffs for binary files from Java?

like image 903
Thilo Avatar asked Aug 14 '26 04:08

Thilo


1 Answers

You can generate binary diffs using badiff; the website is

http://badiff.org/

and it is available on maven central. It's BSD licensed, so friendly for both OSS and commercial. The algorithm used is a chunked version of the O(ND) diff described in this paper:

http://www.xmailserver.org/diff2.pdf

The diff format isn't particularly compatible with anything else, but it produces some really good and really small diffs.

The library is pretty fast; on my desktop machine it can generate a diff for two random 50MB input streams in 54 seconds. Hopefully that's fast enough; I think it's reasonably impressive since that's a comparison of two token streams of 50 million tokens each. badiff will take advantage of multiple CPU cores when computing diffs.

disclaimer: I'm the author of badiff, so of course I think it's cool. I'm always open to suggestions; things like being able to read/write "standard" binary diff formats sound like cool new features to add in upcoming releases.

like image 129
esialb Avatar answered Aug 16 '26 21:08

esialb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!