public Stream GetStream(string filename, System.IO.Packaging.CompressionOption option) { if (FileActive) { throw new InvalidOperationException("A file is already open"); } NativeZip.OpenFile(Handle, filename, ConvertCompression(option)); return(new ZipWriteStream(this)); }
public override void Write(byte[] buffer, int offset, int count) { NativeZip.Write(Archive.Handle, buffer, offset, (uint)count); }
public override void Close() { NativeZip.CloseFile(Archive.Handle); Archive.FileActive = false; }
protected override bool ReleaseHandle() { NativeZip.CloseArchive(this); return(true); }
public void Dispose() { NativeZip.CloseArchive(Handle); Stream.Close(); }
public ZipArchive(Stream stream, Append append, bool ownsStream) { Stream = new ZipStream(stream, ownsStream); Handle = NativeVersion.Use32Bit ? NativeZip.OpenArchive32(Stream.IOFunctions32, append) : NativeZip.OpenArchive64(Stream.IOFunctions64, append); }
public ZipArchive(Stream stream, Append append, bool ownsStream) { Stream = new ZipStream(stream, ownsStream); Handle = NativeZip.OpenArchive(Stream.IOFunctions, append); }