2021-09-27 12:42:46 +00:00
|
|
|
using System.IO;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using Octodiff.Core;
|
|
|
|
using Octodiff.Diagnostics;
|
|
|
|
|
2021-10-23 16:51:17 +00:00
|
|
|
namespace Wabbajack.Installer.Utilities;
|
|
|
|
|
|
|
|
public class BinaryPatching
|
2021-09-27 12:42:46 +00:00
|
|
|
{
|
2022-10-07 22:14:01 +00:00
|
|
|
public static ValueTask ApplyPatch(Stream input, Stream deltaStream, Stream output)
|
2021-09-27 12:42:46 +00:00
|
|
|
{
|
2021-10-23 16:51:17 +00:00
|
|
|
var deltaApplier = new DeltaApplier();
|
|
|
|
deltaApplier.Apply(input, new BinaryDeltaReader(deltaStream, new NullProgressReporter()), output);
|
2022-10-07 22:14:01 +00:00
|
|
|
return ValueTask.CompletedTask;
|
2021-09-27 12:42:46 +00:00
|
|
|
}
|
|
|
|
}
|