-
Unarchives Zlib archive stored in
archiveData.If data passed is not actually a zlib archive,
ZlibErrorwill be thrown.If data inside the archive is not actually compressed with DEFLATE algorithm,
DeflateErrorwill be thrown.Note
This function is specification compliant.
Throws
DeflateErrororZlibErrordepending on the type of inconsistency in data. It may indicate that either the data is damaged or it might not be compressed with zlib or DEFLATE at all.Declaration
Swift
public static func unarchive(archiveData data: Data) throws -> DataParameters
archiveDataData compressed with zlib.
Return Value
Unarchived data.
-
Archives
datainto Zlib archive. Data will be also compressed with DEFLTATE algorithm. It will be specified in archive’s header that the compressor used slowest DEFLATE algorithm.If during compression something goes wrong
DeflateErrorwill be thrown.Note
This function is specification compliant.
Throws
DeflateErrorif an error was encountered during compression.Declaration
Swift
public static func archive(data: Data) throws -> DataParameters
dataData to compress and archive.
Return Value
Data object with resulting archive.
View on GitHub
ZlibArchive Class Reference