Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }