Deflate
public class Deflate : DecompressionAlgorithm
extension Deflate: CompressionAlgorithm
Provides functions for compression and decompression for Deflate algorithm.
-
Decompresses
datausing Deflate algortihm.Note
This function is specification compliant.
Throws
DeflateErrorif unexpected byte (bit) sequence was encountered indata. It may indicate that either data is damaged or it might not be compressed with Deflate at all.Declaration
Swift
public static func decompress(data: Data) throws -> DataParameters
dataData compressed with Deflate.
Return Value
Decompressed data.
-
Compresses
datawith Deflate algortihm.Note
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.
Declaration
Swift
public static func compress(data: Data) -> DataParameters
dataData to compress.
View on GitHub
Deflate Class Reference