10 using System.Runtime.InteropServices;
20 [DllImport(
"ZLIB1.dll", CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)]
23 [DllImport(
"ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
26 [DllImport(
"ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
29 [DllImport(
"ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
32 [DllImport(
"ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
35 [DllImport(
"ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
76 #region Access properties
112 #region Destructor & IDispose stuff
141 #region Basic reading and writing
156 if (!
CanRead)
throw new NotSupportedException();
157 if (
buffer ==
null)
throw new ArgumentNullException();
158 if (
offset < 0 ||
count < 0)
throw new ArgumentOutOfRangeException();
160 if (
_isDisposed)
throw new ObjectDisposedException(
"GZipStream");
162 GCHandle
h = GCHandle.Alloc(
buffer, GCHandleType.Pinned);
168 throw new IOException();
183 if (!
CanRead)
throw new NotSupportedException();
184 if (
_isDisposed)
throw new ObjectDisposedException(
"GZipStream");
201 if (!
CanWrite)
throw new NotSupportedException();
202 if (
buffer ==
null)
throw new ArgumentNullException();
203 if (
offset < 0 ||
count < 0)
throw new ArgumentOutOfRangeException();
205 if (
_isDisposed)
throw new ObjectDisposedException(
"GZipStream");
207 GCHandle
h = GCHandle.Alloc(
buffer, GCHandleType.Pinned);
212 throw new IOException();
228 if (!
CanWrite)
throw new NotSupportedException();
229 if (
_isDisposed)
throw new ObjectDisposedException(
"GZipStream");
233 throw new IOException();
237 #region Position & length stuff
245 throw new NotSupportedException();
257 throw new NotSupportedException();
279 throw new NotSupportedException();
283 throw new NotSupportedException();
296 throw new NotSupportedException();
Implements a compressed Stream, in GZip (.gz) format.
override void SetLength(long value)
Not supported.
~GZipStream()
Destroys this instance
static int gzread(IntPtr gzFile, int data, int length)
GZipStream(string fileName, CompressLevel level)
Creates a new file as a writeable GZipStream
override void Flush()
Flushes the GZipStream.
void Dispose()
Closes the external file handle
static IntPtr gzopen(string name, string mode)
override bool CanRead
Returns true of this stream can be read from, false otherwise
override bool CanSeek
Returns false.
static int gzputc(IntPtr gzFile, int c)
override long Position
Gets/sets the current position in the GZipStream. Not suppported.
static int gzwrite(IntPtr gzFile, int data, int length)
void cleanUp(bool isDisposing)
override void WriteByte(byte value)
Writes a single byte to the stream
override int Read(byte[] buffer, int offset, int count)
Attempts to read a number of bytes from the stream.
override void Write(byte[] buffer, int offset, int count)
Writes a number of bytes to the stream
override bool CanWrite
Returns true if this tsream is writeable, false otherwise
override long Seek(long offset, SeekOrigin origin)
Not suppported.
static int gzclose(IntPtr gzFile)
GZipStream(string fileName)
Opens an existing file as a readable GZipStream
static int gzgetc(IntPtr gzFile)
override int ReadByte()
Attempts to read a single byte from the stream.
The exception that is thrown when an error occurs on the zlib dll
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
CompressLevel
Defines constants for the available compression levels in zlib