Beispiel #1
0
        public DeltaStream(Stream signatureStream, Stream inputStream)
        {
            SignatureFile signatures = SignatureHelpers.ParseSignatureFile(signatureStream);
            IEnumerable <OutputCommand> enumerable = DeltaCalculator.ComputeCommands(new BinaryReader(inputStream), signatures);

            commandsToOutput     = enumerable.GetEnumerator();
            currentCommandStream = new MemoryStream();
            BinaryWriter binaryWriter = new BinaryWriter(currentCommandStream);

            StreamHelpers.WriteBigEndian(binaryWriter, 1920139830uL);
            binaryWriter.Flush();
            currentCommandStream.Seek(0L, SeekOrigin.Begin);
        }
Beispiel #2
0
        public DeltaStream(Stream signatureStream, Stream inputStream)
        {
            var signature   = SignatureHelpers.ParseSignatureFile(signatureStream);
            var inputReader = new BinaryReader(inputStream);
            var commands    = DeltaCalculator.ComputeCommands(inputReader, signature);

            this.commandsToOutput = commands.GetEnumerator();

            this.currentCommandStream = new MemoryStream();
            var writer = new BinaryWriter(this.currentCommandStream);

            StreamHelpers.WriteBigEndian(writer, (uint)MagicNumber.Delta);
            writer.Flush();
            this.currentCommandStream.Seek(0, SeekOrigin.Begin);
        }