Copy from xdelta project https://code.google.com/p/xdelta/