Example #1
0
 public static byte[] GetPatch(byte[] oldData, byte[] newData)
 {
     using (var ms = new MemoryStream())
     {
         BinaryPatchUtility.Create(
             oldData,
             newData,
             ms
             );
         return(ms.ToArray());
     }
 }
Example #2
0
 public static byte[] ApplyPatch(byte[] oldData, byte[] patchData)
 {
     using (var msInput = new MemoryStream(oldData))
     {
         var openPatchFuncStream = (Func <Stream>)(
             () => new MemoryStream(patchData)
             );
         using (var outputStream = new MemoryStream())
         {
             BinaryPatchUtility.Apply(
                 msInput,
                 openPatchFuncStream,
                 outputStream
                 );
             return(outputStream.ToArray());
         }
     }
 }