1 // ZipWriteStream.cs created with MonoDevelop
2 // User: alan at 16:54 20/10/2008
4 // To change standard headers go to Edit->Preferences->Coding->Standard Headers
12 class ZipWriteStream
: Stream
14 ZipArchive Archive { get; set; }
16 public override bool CanRead
{
20 public override bool CanSeek
{
24 public override bool CanWrite
{
28 public override bool CanTimeout
{
32 public override long Length
{
34 throw new NotSupportedException ();
38 public override long Position
{
40 throw new NotSupportedException ();
43 throw new NotSupportedException ();
47 public ZipWriteStream (ZipArchive 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
);