9 using System.Diagnostics;
10 using System.Runtime.InteropServices;
21 [DllImport(
"ZLIB1.dll", CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)]
24 [DllImport(
"ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
27 [DllImport(
"ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
30 [DllImport(
"ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
41 throw new ZLibException(retval,
"Could not initialize inflater");
56 if (data ==
null)
throw new ArgumentNullException();
57 if (
offset < 0 ||
count < 0)
throw new ArgumentOutOfRangeException();
58 if ((
offset+
count) > data.Length)
throw new ArgumentException();
64 while (
err >= 0 && inputIndex < total)
Implements the common functionality needed for all Codecs
ZStream _ztream
Instance of the internal zlib buffer structure that is passed to all functions in the zlib dll
void OnDataAvailable()
Fires the DataAvailable event
void setChecksum(uint newSum)
Updates the running checksum property
const int kBufferSize
The size of the internal buffers
void resetOutput()
Resets the internal output buffers to a known state - ready for processing
void copyInput(byte[] data, int startIndex, int count)
Copies a number of bytes to the internal codec buffer - ready for proccesing
Implements a data decompressor, using the inflate algorithm in the ZLib dll
static int inflateReset(ref ZStream sz)
static int inflate(ref ZStream sz, int flush)
override void Add(byte[] data, int offset, int count)
Adds more data to the codec to be processed.
static int inflateEnd(ref ZStream sz)
override void Finish()
Finishes up any pending data that needs to be processed and handled.
Inflater()
Constructs an new instance of the Inflater
static int inflateInit_(ref ZStream sz, string vs, int size)
override void CleanUp()
Closes the internal zlib inflate stream
Encapsulates general information about the ZLib library
static string Version
Gets the version of ZLib as a string, e.g. "1.2.1"
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
FlushTypes
Defines constants for the various flush types used with zlib