public class Deflate : DecompressionAlgorithm
extension Deflate: CompressionAlgorithm
Provides functions for compression and decompression for Deflate algorithm.
datausing Deflate algortihm.
This function is specification compliant.
DeflateErrorif unexpected byte (bit) sequence was encountered in
data. It may indicate that either data is damaged or it might not be compressed with Deflate at all.
public static func decompress(data: Data) throws -> Data
Data compressed with Deflate.
datawith Deflate algortihm.
Currently, SWCompression creates only one block for all data and the block can either be uncompressed or compressed with static Huffman encoding. Choice of one block type or the other depends on bytes’ statistics of data. However, if data size is greater than 65535 (the maximum value stored in 2 bytes), then static Huffman block will be created.
public static func compress(data: Data) -> Data
Data to compress.