BZip2
public class BZip2: DecompressionAlgorithm
Provides functions for compression and decompression for BZip2 algorithm.
-
Decompresses
datausing BZip2 algortihm.Throws
BZip2Errorif unexpected byte (bit) sequence was encountered indata. It may indicate that either data is damaged or it might not be compressed with BZip2 at all.Declaration
Swift
public static func decompress(data: Data) throws -> DataParameters
dataData compressed with BZip2.
Return Value
Decompressed data.
-
Compresses
datawith BZip2 algortihm.Note
Input data will be split into blocks of size 100 KB. Use
BZip2.compress(data:blockSize:)function to specify size of a block.Declaration
Swift
public static func compress(data: Data) -> DataParameters
dataData to compress.
-
Compresses
datawith BZip2 algortihm, splitting data into blocks of specifiedblockSize.Declaration
Swift
public static func compress(data: Data, blockSize: BlockSize) -> DataParameters
dataData to compress.
blockSizeSize of blocks in which
datawill be split.
-
Represents size of blocks in which data is split during BZip2 compression.
See moreDeclaration
Swift
public enum BlockSize: Int
View on GitHub
BZip2 Class Reference