Example #1
0
 public ZipFile(Stream stream)
 {
     this.useZip64_ = ICSharpCode.SharpZipLib.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();
             return;
         }
         catch
         {
             this.DisposeInternal(true);
             throw;
         }
     }
     this.entries_ = new ZipEntry[0];
     this.isNewArchive_ = true;
 }
Example #2
0
 public ZipFile(FileStream file)
 {
     this.useZip64_ = ICSharpCode.SharpZipLib.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;
     }
 }
Example #3
0
 internal ZipFile()
 {
     this.useZip64_ = ICSharpCode.SharpZipLib.Zip.UseZip64.Dynamic;
     this.bufferSize_ = 0x1000;
     this.updateEntryFactory_ = new ZipEntryFactory();
     this.entries_ = new ZipEntry[0];
     this.isNewArchive_ = true;
 }
Example #4
0
 public ZipOutputStream(Stream baseOutputStream, int bufferSize) : base(baseOutputStream, new Deflater(-1, true), bufferSize)
 {
     this.entries = new ArrayList();
     this.crc     = new Crc32();
     this.defaultCompressionLevel = -1;
     this.curMethod    = CompressionMethod.Deflated;
     this.zipComment   = new byte[0];
     this.crcPatchPos  = -1L;
     this.sizePatchPos = -1L;
     this.useZip64_    = ICSharpCode.SharpZipLib.Zip.UseZip64.Dynamic;
 }
Example #5
0
 public ZipOutputStream(Stream baseOutputStream, int bufferSize) : base(baseOutputStream, new Deflater(-1, true), bufferSize)
 {
     this.entries = new ArrayList();
     this.crc = new Crc32();
     this.defaultCompressionLevel = -1;
     this.curMethod = CompressionMethod.Deflated;
     this.zipComment = new byte[0];
     this.crcPatchPos = -1L;
     this.sizePatchPos = -1L;
     this.useZip64_ = ICSharpCode.SharpZipLib.Zip.UseZip64.Dynamic;
 }
Example #6
0
 public FastZip(FastZipEvents events)
 {
     this.entryFactory_ = new ZipEntryFactory();
     this.useZip64_     = ICSharpCode.SharpZipLib.Zip.UseZip64.Dynamic;
     this.events_       = events;
 }
Example #7
0
 public FastZip(FastZipEvents events)
 {
     this.entryFactory_ = new ZipEntryFactory();
     this.useZip64_ = ICSharpCode.SharpZipLib.Zip.UseZip64.Dynamic;
     this.events_ = events;
 }
Example #8
0
 public ZipFile(string name)
 {
     this.useZip64_ = ICSharpCode.SharpZipLib.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;
     }
 }