예제 #1
0
        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();
        }
예제 #2
0
        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();
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }