Functions
The following functions are available globally.
-
Compresses the given data using the specified compression method.
Throws
An error if the compression process fails.Declaration
Swift
public func compressData(_ data: Data, method: CompressionMethod) throws -> Data
Parameters
data
The data to be compressed.
method
The compression method to use.
Return Value
The compressed data.
-
Decompresses the given data using the specified compression method.
Throws
An error if the decompression process fails.Declaration
Swift
public func decompressData(_ data: Data, method: CompressionMethod) throws -> Data
Parameters
data
The compressed data to be decompressed.
method
The compression method used to compress the data.
Return Value
The decompressed data.