Example #1
0
        private static void ReplaceArchive(Options options)
        {
            if (options.ArdFilename == null)
            {
                throw new NullReferenceException("Archive must be specified");
            }
            if (options.Input == null)
            {
                throw new NullReferenceException("No input file was specified.");
            }
            if (options.Output == null)
            {
                throw new NullReferenceException("No output file was specified.");
            }

            using (var archive = new FileArchive(options.ArhFilename, options.ArdFilename))
            {
                byte[] replacement = File.ReadAllBytes(options.Input);
                archive.ReplaceFile(options.Output, replacement);
            }
        }