2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
[mcs.git] / class / WindowsBase / ZipSharp / ZipWriteStream.cs
blobfbacd9d90dbc27b888b192e030fe49a001520ad9
1 // ZipWriteStream.cs created with MonoDevelop
2 // User: alan at 16:54 20/10/2008
3 //
4 // To change standard headers go to Edit->Preferences->Coding->Standard Headers
5 //
7 using System;
8 using System.IO;
10 namespace zipsharp
12 class ZipWriteStream : Stream
14 ZipArchive Archive { get; set; }
16 public override bool CanRead {
17 get { return false; }
20 public override bool CanSeek {
21 get { return false; }
24 public override bool CanWrite {
25 get { return true; }
28 public override bool CanTimeout {
29 get { return false; }
32 public override long Length {
33 get {
34 throw new NotSupportedException ();
38 public override long Position {
39 get {
40 throw new NotSupportedException ();
42 set {
43 throw new NotSupportedException ();
47 public ZipWriteStream (ZipArchive archive)
49 Archive = archive;
50 Archive.FileActive = true;
53 public override void Close()
55 NativeZip.CloseFile (Archive.Handle);
56 Archive.FileActive = false;
59 public override void Flush()
64 public override int Read(byte[] buffer, int offset, int count)
66 throw new NotSupportedException ();
69 public override long Seek(long offset, SeekOrigin origin)
71 throw new NotSupportedException ();
74 public override void SetLength(long value)
76 throw new NotSupportedException ();
79 public override void Write(byte[] buffer, int offset, int count)
81 NativeZip.Write (Archive.Handle, buffer, offset, (uint)count);