Deflate
public final class Deflate: DecompressionAlgorithm
Provides function to decompress data, which were compressed with DEFLATE.
-
Decompresses
compressedDatawith DEFLATE algortihm.If data passed is not actually compressed with DEFLATE,
DeflateErrorwill be thrown.Throws
DeflateErrorif unexpected byte (bit) sequence was encountered incompressedData. It may indicate that either the data is damaged or it might not be compressed with DEFLATE at all.Declaration
Swift
public static func decompress(compressedData data: Data) throws -> DataParameters
compressedDataData compressed with DEFLATE.
Return Value
Decompressed data.
-
Compresses
datawith DEFLATE algortihm.If during compression something goes wrong
DeflateErrorwill be thrown.Note
Currently, SWCompression creates only one block for all data and the block can either be uncompressed or compressed with static Huffman encoding. Uncompressed block is created if amount of data provided is less than 3 bytes and static Huffman is used in all other cases.Declaration
Swift
public static func compress(data: Data) throws -> Data
View on GitHub
Deflate Class Reference