/// <summary>
        /// Zip尾部目录的实例化
        /// </summary>
        /// <param name="fdList"></param>
        /// <param name="totalFileSize"></param>
        /// <returns></returns>
        private E_EndCentralDirRecord EndDirInstance(List <E_FileAndDir> fdList, int totalFileSize)
        {
            E_EndCentralDirRecord e = new E_EndCentralDirRecord();

            //当前磁盘编号默认0
            //核心目录开始位置的磁盘编号也为0
            e.DirNum              = BitConverter.GetBytes((short)fdList.Count);
            e.DirStructCnt        = e.DirNum;
            e.DirSize             = GetClassSize(fdList.Select(s => s.Dir).ToList());
            e.DirOffsefForArchive = GetClassSize(fdList.Select(s => s.Header).ToList(), totalFileSize);
            return(e);
        }
        /// <summary>
        /// 构建Zip结构
        /// </summary>
        /// <returns></returns>
        private E_VirtualZipStruct BuildZipStruct()
        {
            E_VirtualZipStruct zipStruct = new E_VirtualZipStruct();
            //定义头部和目录的集合(用于计算目录偏移量)
            List <E_FileAndDir> fdList = new List <E_FileAndDir>();
            //合计文件大小
            long totalFileSize = 0;
            //虚拟压缩包总大小(包含文件大小和头部,目录,尾部区域的字节)
            long virtualZipSize = 0;

            foreach (var file in fileList)
            {
                //1.构造头部区域
                E_LocalFileHeader header = FileHeaderInstance(file);
                zipStruct.Header.Add(new Tuple <byte[], string>(header.GetAllBytes(), file.PhyFilePath));
                virtualZipSize += header.GetAllBytes().Count();
                //2.构造目录部分
                E_CentralDirFileHeader dir = CentralDirInstance(file);
                //计算dir的偏移量
                if (fdList.Count > 0)
                {
                    dir.HeaderOffset = GetClassSize(fdList.Select(s => s.Header).ToList(), (int)totalFileSize);
                }
                zipStruct.Dir.AddRange(dir.GetAllBytes());
                //向头部和目录集合添加记录
                fdList.Add(new E_FileAndDir()
                {
                    Header = header,
                    Dir    = dir
                });
                totalFileSize += file.FileSize;
            }
            E_EndCentralDirRecord endDir = EndDirInstance(fdList, (int)totalFileSize);

            zipStruct.End.AddRange(endDir.GetAllBytes());
            virtualZipSize       += zipStruct.Dir.Count();
            virtualZipSize       += zipStruct.End.Count();
            virtualZipSize       += totalFileSize;
            zipStruct.ZipFileSize = (uint)virtualZipSize;
            return(zipStruct);
        }