示例#1
0
        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));
        }
示例#2
0
 public override void Write(byte[] buffer, int offset, int count)
 {
     NativeZip.Write(Archive.Handle, buffer, offset, (uint)count);
 }
示例#3
0
 public override void Close()
 {
     NativeZip.CloseFile(Archive.Handle);
     Archive.FileActive = false;
 }
示例#4
0
 protected override bool ReleaseHandle()
 {
     NativeZip.CloseArchive(this);
     return(true);
 }
示例#5
0
 public void Dispose()
 {
     NativeZip.CloseArchive(Handle);
     Stream.Close();
 }
示例#6
0
 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);
 }
示例#7
0
 public ZipArchive(Stream stream, Append append, bool ownsStream)
 {
     Stream = new ZipStream(stream, ownsStream);
     Handle = NativeZip.OpenArchive(Stream.IOFunctions, append);
 }