-
Unarchives XZ archive.
If data passed is not actually XZ archive,
XZErrorwill be thrown. Particularly, if filters other than LZMA2 are used in archive, thenXZError.wrongFilterwill be thrown.If an error happens during LZMA2 decompression, then
LZMAErrororLZMA2Errorwill be thrown.Throws
LZMAError,LZMA2ErrororXZErrordepending on the type of the problem. It may indicate that either the archive is damaged or it might not be compressed with XZ or LZMA(2) at all.Declaration
Swift
public static func unarchive(archive data: Data) throws -> DataParameters
archiveData archived using XZ format.
Return Value
Unarchived data.
-
Unarchives XZ archive which contains one or more streams.
Note
wrongCheckerror contains only last processed stream’s data as their associated value instead of all successfully processed members. This is a known issue and it will be fixed in future major version because solution requires backwards-incompatible API changes.Throws
LZMAError,LZMA2ErrororXZErrordepending on the type of the problem. It may indicate that one of the streams of archive is damaged or it might not be archived with XZ or LZMA(2) at all.Declaration
Swift
public static func multiUnarchive(archive data: Data) throws -> [Data]Parameters
archiveXZ archive with one or more streams.
Return Value
Unarchived data.
View on GitHub
XZArchive Class Reference