Example #1
0
        void SaveFile(string fileName, InternalZipFile file)
        {
            using (FileStream stream = new FileStream(fileName, FileMode.Create)) {
                StreamHelper.WriteTo(file.FileDataStream, stream);
            }
            FileInfo fileInfo = new FileInfo(fileName);

            fileInfo.LastWriteTime = file.FileLastModificationTime;
        }
 public override byte[] GetData(string url)
 {
     // Open ZIP archive.
     using (ZipFilesHelper helper = new ZipFilesHelper(StoragePath)) {
         // Read a file with a specified URL from the archive.
         InternalZipFile zipFile = GetZipFile(helper.ZipFiles, url);
         if (zipFile != null)
         {
             return(GetBytes(zipFile));
         }
         return(new byte[] { });
     }
 }
 static byte[] GetBytes(InternalZipFile zipFile)
 {
     return(GetBytes(zipFile.FileDataStream, (int)zipFile.UncompressedSize));
 }