static void DecodingExample() { byte[] sourceFile = new byte[] { }; List<byte> result = new List<byte>(); using (VCDiffDotNet.LowLevel.Decoder decoder = new VCDiffDotNet.LowLevel.Decoder()) { int maxSize = 1 << 24; decoder.InitDecoder(sourceFile, true, maxSize, maxSize); decoder.StartDecoding(); byte[] partialOutput; byte[] partOfPatchFile = new byte[] { }; decoder.DecodeChunk(partOfPatchFile, out partialOutput); result.AddRange(partialOutput); decoder.FinishDecoding(); } byte[] targetFile = result.ToArray(); }
static void DecodingExample() { byte[] sourceFile = new byte[] { }; List <byte> result = new List <byte>(); using (VCDiffDotNet.LowLevel.Decoder decoder = new VCDiffDotNet.LowLevel.Decoder()) { int maxSize = 1 << 24; decoder.InitDecoder(sourceFile, true, maxSize, maxSize); decoder.StartDecoding(); byte[] partialOutput; byte[] partOfPatchFile = new byte[] { }; decoder.DecodeChunk(partOfPatchFile, out partialOutput); result.AddRange(partialOutput); decoder.FinishDecoding(); } byte[] targetFile = result.ToArray(); }
static void DecodingExample() { byte[] sourceFile = File.ReadAllBytes(@"C:\tmp\diff\test.7z"); List<byte> result = new List<byte>(); using (VCDiffDotNet.LowLevel.Decoder decoder = new VCDiffDotNet.LowLevel.Decoder()) { int maxSize = 1 << 24; decoder.InitDecoder(sourceFile, true, maxSize, maxSize); decoder.StartDecoding(); byte[] partialOutput; byte[] partOfPatchFile = File.ReadAllBytes(@"C:\tmp\diff\test.patch"); decoder.DecodeChunk(partOfPatchFile, out partialOutput); result.AddRange(partialOutput); decoder.FinishDecoding(); } byte[] targetFile = result.ToArray(); File.WriteAllBytes(@"C:\tmp\diff\test-patched.7z", targetFile); }
static void DecodingExample() { byte[] sourceFile = File.ReadAllBytes(@"C:\tmp\diff\test.7z"); List <byte> result = new List <byte>(); using (VCDiffDotNet.LowLevel.Decoder decoder = new VCDiffDotNet.LowLevel.Decoder()) { int maxSize = 1 << 24; decoder.InitDecoder(sourceFile, true, maxSize, maxSize); decoder.StartDecoding(); byte[] partialOutput; byte[] partOfPatchFile = File.ReadAllBytes(@"C:\tmp\diff\test.patch"); decoder.DecodeChunk(partOfPatchFile, out partialOutput); result.AddRange(partialOutput); decoder.FinishDecoding(); } byte[] targetFile = result.ToArray(); File.WriteAllBytes(@"C:\tmp\diff\test-patched.7z", targetFile); }