File tree Expand file tree Collapse file tree
QuestAppVersionSwitcher/DiffDowngrading Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments