logosbible / bsdiff.net Goto Github PK
View Code? Open in Web Editor NEWA .NET port of Colin Percival's bsdiff & bspatch
License: MIT License
A .NET port of Colin Percival's bsdiff & bspatch
License: MIT License
Usually I think in use delta patches when the original file is too big, but the patcher method require to the entire file be loaded in the memory instead accept stream as input, there's a reason for that?
Hi,
Thanks for sharing your work.
I created a patch for a 170MB exe file. (I used IDA for that).
I am trying your C# code generate a diff to try to duplicate the patch.
While running the BsDiff I receive an overflow error in:
private static void Split(int[] I, int[] v, int start, int len, int h)
System.StackOverflowException
HResult=0x800703E9
Message=Exception of type 'System.StackOverflowException' was thrown.
Can it handle 170MB files?
Thanks
Hi
First, congratulations for this c# port of bsdiff algorithm. It is very helpful for me, so I decide to share some code :)
I decide to write a wrapper to avoid problem with memory consumption on large files. The wrapper uses yours BinaryPatchUtility.cs (with just one modification) as basis but splits files in chunks and make diffs over them, then combine all chunks in single patch file. Because of slow diff generation on large files (over 1Gb) wrapper has feature to make diffs on chunks in parallel mode. When applying patch, wrapper reads chunk diffs and make new file from them.
Wrapper and demo source code.BsDiffPatchChunked.zip
Best,
Tenyo Tyankov
StackOverflowException is thrown with these files.
Source: https://www.dropbox.com/s/3iw73ey75zuhlut/Source.exe?dl=0
Target: https://www.dropbox.com/s/dck4zo86d773gle/Target.exe?dl=0
Currently, only Func argument supported for telling patch file.
It seems strange for normal usage.
And also concerned about disposing opened stream via Func<>.
The BZip2InputStream from ICSharpCode.SharpZipLib.BZip2 has a property named "IsStreamOwner" that makes WrappingStream redundant.
In the interests of reducing external dependencies, I think it would be a good change to remove the LogosBible.Utility reference and just set "IsStreamOwner" to false in the Bzip2InputStream initializer.
Description from the ICSharpCode documentation (http://bit.ly/1nex97g):
bool IsStreamOwner [get, set]
Get/set flag indicating ownership of underlying stream. When the flag is true Close will close the underlying stream also.
An exception is thrown when the old file is empty.
where is the source code of ICSharpCode.SharpZipLib.dll ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.