Class RawDeflate

Namespace
CHDSharp.Encoder
Assembly
CHDSharpLib.dll

Provides raw DEFLATE compression and decompression utilities.

public static class RawDeflate
Inheritance
RawDeflate
Inherited Members

Methods

Compress(byte[])

Compresses data using raw DEFLATE, stripping any Zlib header/trailer. Uses the vendored zlib 1.3.1 C# port with chdman's exact parameters — byte-for-byte identical to chdman -c zlib (verified 562/562 hunks vs chdman).

public static byte[]? Compress(byte[] data)

Parameters

data byte[]

The uncompressed input data.

Returns

byte[]

The compressed bytes, or null if compression did not reduce size.

Decompress(byte[], int)

Decompresses raw DEFLATE data to the specified original size.

public static byte[] Decompress(byte[] compressed, int originalSize)

Parameters

compressed byte[]

The compressed input data.

originalSize int

The expected number of uncompressed bytes.

Returns

byte[]

The decompressed byte array.