-
Decompresses
data
using LZMA.Note
It is assumed that the first nine bytes of
data
represent standard LZMA properties (so called “lc”, “lp” and “pb”), dictionary size, and uncompressed size all encoded with standard encoding scheme of LZMA format.Throws
LZMAError
if unexpected byte (bit) sequence was encountered indata
. It may indicate that either data is damaged or it might not be compressed with LZMA at all.Declaration
Swift
public static func decompress(data: Data) throws -> Data
Parameters
data
Data compressed with LZMA.
Return Value
Decompressed data.
-
Decompresses
data
using LZMA with specified algorithm’sproperties
, and, optionally, output’suncompressedSize
. IfuncompressedSize
is nil, thendata
must contain finish marker.Note
It is assumed that
data
begins immediately with LZMA compressed bytes with no LZMA properties at the beginning.Warning
There is no validation performed for properties of
properties
argument. This API is intended to be used by advanced users.Throws
LZMAError
if unexpected byte (bit) sequence was encountered indata
. It may indicate that either data is damaged or it might not be compressed with LZMA at all.Declaration
Swift
public static func decompress(data: Data, properties: LZMAProperties, uncompressedSize: Int? = nil) throws -> Data
Parameters
data
Data compressed with LZMA.
properties
Properties of LZMA (such as lc, lp, etc.)
uncompressedSize
Size of uncompressed data;
nil
if it is unknown. In case ofnil
, finish marker must be present indata
.Return Value
Decompressed data.