MCPcopy Create free account
hub / github.com/Squirrel/Squirrel.Windows / Create

Method Create

src/Squirrel/BinaryPatchUtility.cs:50–72  ·  view source on GitHub ↗

Creates a binary patch (in bsdiff format) that can be used (by ) to transform into . The original binary data. The new binary data. A to which the patch wil

(byte[] oldData, byte[] newData, Stream output)

Source from the content-addressed store, hash-verified

48 /// <param name="newData">The new binary data.</param>
49 /// <param name="output">A <see cref="Stream"/> to which the patch will be written.</param>
50 public static void Create(byte[] oldData, byte[] newData, Stream output)
51 {
52 // NB: If you diff a file big enough, we blow the stack. This doesn't
53 // solve it, just buys us more space. The solution is to rewrite Split
54 // using iteration instead of recursion, but that's Hard(tm).
55 var ex = default(Exception);
56 var t = new Thread(() =>
57 {
58 try
59 {
60 CreateInternal(oldData, newData, output);
61 }
62 catch (Exception exc)
63 {
64 ex = exc;
65 }
66 }, 40 * 1048576);
67
68 t.Start();
69 t.Join();
70
71 if (ex != null) throw ex;
72 }
73
74 static void CreateInternal(byte[] oldData, byte[] newData, Stream output)
75 {

Callers

nothing calls this directly

Calls 1

StartMethod · 0.80

Tested by

no test coverage detected