Skip to content

Commit 3731070

Browse files
committed
switch to different library
1 parent 8d03974 commit 3731070

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

QuestAppVersionSwitcher/DiffDowngrading/DiffDowngrader.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,17 @@ public void Done()
198198

199199
public void ApplyPatch(string sourcePath, string diffPath, string outputPath)
200200
{
201-
using (FileStream sourceStream = File.OpenRead(sourcePath))
201+
FileManager.CreateDirectoryIfNotExisting(FileManager.GetParentDirIfExisting(outputPath));
202+
using (FileStream input = File.OpenRead(sourcePath))
202203
{
203-
using (FileStream diffStream = File.OpenRead(diffPath))
204-
{
204+
using(FileStream patch = File.OpenRead(diffPath)) {
205205
using (FileStream output = File.Create(outputPath))
206206
{
207-
VCDiff.Decoders.VcDecoder decoder = new VCDiff.Decoders.VcDecoder(sourceStream, diffStream, output);
208-
long bytesWritten;
209207
Logger.Log("Decoding diff file for " + sourcePath + " with " + diffPath + " to " + outputPath);
210-
decoder.Decode(out bytesWritten);
211-
Logger.Log("Wrote " + bytesWritten + " bytes to " + outputPath);
208+
PleOps.XdeltaSharp.Decoder.Decoder decoder = new PleOps.XdeltaSharp.Decoder.Decoder(input, patch, output);
209+
decoder.Run();
212210
decoder.Dispose();
211+
Logger.Log("Decoded!");
213212
}
214213
}
215214
}

0 commit comments

Comments
 (0)