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; }
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; } }
internal ZipFile() { this.useZip64_ = ICSharpCode.SharpZipLib.Zip.UseZip64.Dynamic; this.bufferSize_ = 0x1000; this.updateEntryFactory_ = new ZipEntryFactory(); this.entries_ = new ZipEntry[0]; this.isNewArchive_ = true; }
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; }
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; }
public FastZip(FastZipEvents events) { this.entryFactory_ = new ZipEntryFactory(); this.useZip64_ = ICSharpCode.SharpZipLib.Zip.UseZip64.Dynamic; this.events_ = events; }
public FastZip(FastZipEvents events) { this.entryFactory_ = new ZipEntryFactory(); this.useZip64_ = ICSharpCode.SharpZipLib.Zip.UseZip64.Dynamic; this.events_ = events; }
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; } }