Data
extension Data
-
Whether the receiver is compressed in gzip format.
Declaration
Swift
public var isGzipped: Bool -
Create a new
Datainstance by compressing the receiver using zlib. Throws an error if compression failed.The
wBitsparameter allows for managing the size of the history buffer. The possible values are:Value Window size logarithm Input +9 to +15 Base 2 Includes zlib header and trailer -9 to -15 Absolute value of wbits No header and trailer +25 to +31 Low 4 bits of the value Includes gzip header and trailing checksumThrows
GzipErrorDeclaration
Swift
public func gzipped(level: CompressionLevel = .defaultCompression, wBits: Int32 = GzipStatics.maxWindowBits + 16) throws -> DataParameters
levelCompression level.
wBitsManage the size of the history buffer.
Return Value
Gzip-compressed
Datainstance. -
Create a new
Datainstance by decompressing the receiver using zlib. Throws an error if decompression failed.The
wBitsparameter allows for managing the size of the history buffer. The possible values are:Value Window size logarithm Input +8 to +15 Base 2 Includes zlib header and trailer -8 to -15 Absolute value of wbits Raw stream with no header and trailer +24 to +31 = 16 + (8 to 15) Low 4 bits of the value Includes gzip header and trailer +40 to +47 = 32 + (8 to 15) Low 4 bits of the value zlib or gzip formatThrows
GzipErrorDeclaration
Swift
public func gunzipped(wBits: Int32 = GzipStatics.maxWindowBits + 32) throws -> DataParameters
wBitsManage the size of the history buffer.
Return Value
Gzip-decompressed
Datainstance.
View on GitHub
Install in Dash