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)]
42 throw new ZLibException(retval,
"Could not initialize deflater");
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 compressor, using the deflate algorithm in the ZLib dll
static int deflateEnd(ref ZStream sz)
override void Add(byte[] data, int offset, int count)
Adds more data to the codec to be processed.
Deflater(CompressLevel level)
Constructs an new instance of the Deflater
static int deflate(ref ZStream sz, int flush)
override void Finish()
Finishes up any pending data that needs to be processed and handled.
static int deflateInit_(ref ZStream sz, int level, string vs, int size)
static int deflateReset(ref ZStream sz)
override void CleanUp()
Closes the internal zlib deflate 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
CompressLevel
Defines constants for the available compression levels in zlib
FlushTypes
Defines constants for the various flush types used with zlib