Exemplo n.º 1
0
        /// <summary>
        /// Adds a Web Resource that will be downloaded when extracting.
        /// </summary>
        /// <param name="url">URL of the Web Resource to be used.</param>
        /// <param name="archiveFile">The Archive Path where the WebResource should be stored.</param>
        public void AddWeb(string url, string archiveFile)
        {
            Console.WriteLine($"Adding Web Node: {url} to {archiveFile}");
            byte[] b        = Encoding.UTF8.GetBytes(url);
            int    startIdx = _archiveHeader.CreateDataNode(ConvertToArchivePath(archiveFile), b.Length, ArchiveHeader.ArchiveNodeType.Web);

            _archiveStream.Position = startIdx;
            _archiveStream.Write(b, 0, b.Length);
        }