Exemplo n.º 1
0
 public ZipFile(Stream stream)
 {
     this.useZip64_ = Maticsoft.ZipLib.Zip.UseZip64.Dynamic;
     this.bufferSize_ = 0x1000;
     this.updateEntryFactory_ = new ZipEntryFactory();
     if (stream == null)
     {
         throw new ArgumentNullException("stream");
     }
     if (!stream.CanSeek)
     {
         throw new ArgumentException("Stream is not seekable", "stream");
     }
     this.baseStream_ = stream;
     this.isStreamOwner = true;
     if (this.baseStream_.Length > 0L)
     {
         try
         {
             this.ReadEntries();
         }
         catch
         {
             this.DisposeInternal(true);
             throw;
         }
     }
     else
     {
         this.entries_ = new ZipEntry[0];
         this.isNewArchive_ = true;
     }
 }
Exemplo n.º 2
0
 public ZipFile(FileStream file)
 {
     this.useZip64_ = Maticsoft.ZipLib.Zip.UseZip64.Dynamic;
     this.bufferSize_ = 0x1000;
     this.updateEntryFactory_ = new ZipEntryFactory();
     if (file == null)
     {
         throw new ArgumentNullException("file");
     }
     if (!file.CanSeek)
     {
         throw new ArgumentException("Stream is not seekable", "file");
     }
     this.baseStream_ = file;
     this.name_ = file.Name;
     this.isStreamOwner = true;
     try
     {
         this.ReadEntries();
     }
     catch
     {
         this.DisposeInternal(true);
         throw;
     }
 }
Exemplo n.º 3
0
 internal ZipFile()
 {
     this.useZip64_ = Maticsoft.ZipLib.Zip.UseZip64.Dynamic;
     this.bufferSize_ = 0x1000;
     this.updateEntryFactory_ = new ZipEntryFactory();
     this.entries_ = new ZipEntry[0];
     this.isNewArchive_ = true;
 }
Exemplo n.º 4
0
 public ZipFile(string name)
 {
     this.useZip64_ = Maticsoft.ZipLib.Zip.UseZip64.Dynamic;
     this.bufferSize_ = 0x1000;
     this.updateEntryFactory_ = new ZipEntryFactory();
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     this.name_ = name;
     this.baseStream_ = File.Open(name, FileMode.Open, FileAccess.Read, FileShare.Read);
     this.isStreamOwner = true;
     try
     {
         this.ReadEntries();
     }
     catch
     {
         this.DisposeInternal(true);
         throw;
     }
 }