Ejemplo n.º 1
0
 public static byte[] Decompress(byte[] data)
 {
     return(ZipLib.Decompress(data));
 }
Ejemplo n.º 2
0
 private string openZipEntry(
     string fileName,
     ZipLib.Zip.ZipFile zip, ZipLib.Zip.ZipEntry entry,
     string source)
 {
     using (Stream s = zip.GetInputStream(entry))
     {
         byte[] data = new byte[entry.Size];
         s.Read(data, 0, data.Length);
         using (MemoryStream ms = new MemoryStream(data))
         {
             if (intCheckCanOpenFileName(entry.Name))
             {
                 openStream(ms, Path.GetExtension(entry.Name).ToUpper(), source, true);
             }
             else
             {
                 DialogProvider.Show(
                     string.Format("Can't open {0}\\{1}!\n\nFile not supported!", fileName, entry.Name),
                     "Error",
                     DlgButtonSet.OK,
                     DlgIcon.Error);
                 return string.Empty;
             }
             return string.Format("{0}/{1}", Path.GetFileName(fileName), entry.Name);
         }
     }
 }