/// <summary>
        /// Creates the patch based on the difference between two streams.
        /// </summary>
        /// <param name="baseStream">The untouched stream.</param>
        /// <param name="modStream">The modified stream.</param>
        public override sealed void Create(Stream baseStream, Stream modStream)
        {
            using (HashStream <TPatchAlgorithm> patchHashStream = new HashStream <TPatchAlgorithm>(BaseStream, HashAlgorithm))
                using (HashStream <TBaseAlgorithm> baseHashStream = new HashStream <TBaseAlgorithm>(baseStream))
                    using (HashStream <TModAlgorithm> modHashStream = new HashStream <TModAlgorithm>(modStream))
                    {
                        BaseStream = patchHashStream;
                        patchHashStream.Initialize();
                        Create(patchHashStream, baseHashStream, modHashStream);

                        if (!baseHashStream.HasFlushedFinalBlock)
                        {
                            baseHashStream.Position = baseHashStream.Length;
                            baseHashStream.FlushFinalBlock();
                        }

                        if (!modHashStream.HasFlushedFinalBlock)
                        {
                            modHashStream.Position = modHashStream.Length;
                            modHashStream.FlushFinalBlock();
                        }

                        WriteVerificationFooter(patchHashStream, baseHashStream, modHashStream);

                        BaseStream = patchHashStream.BaseStream;
                    }
        }
        /// <summary>
        /// Analyzes the entire patch.
        /// </summary>
        protected override void Analyze()
        {
            using (HashStream <TPatchAlgorithm> patchHashStream = new HashStream <TPatchAlgorithm>(BaseStream, HashAlgorithm))
            {
                BaseStream = patchHashStream;
                patchHashStream.Initialize();
                base.Analyze();
                AnalyzeVerificationFooter(patchHashStream);

                if (!patchHashStream.HasFlushedFinalBlock)
                {
                    patchHashStream.FlushFinalBlock();
                }

                BaseStream = patchHashStream.BaseStream;
            }
        }