Data
extension Data
-
Compress the output of
provider
and pass it toconsumer
.Declaration
Parameters
size
The uncompressed size of the data to be compressed.
bufferSize
The maximum size of the compression buffer.
provider
A closure that accepts a position and a chunk size. Returns a
Data
chunk.consumer
A closure that processes the result of the compress operation.
Return Value
The checksum of the processed content.
-
Decompress the output of
provider
and pass it toconsumer
.Declaration
Parameters
size
The compressed size of the data to be decompressed.
bufferSize
The maximum size of the decompression buffer.
skipCRC32
Optional flag to skip calculation of the CRC32 checksum to improve performance.
provider
A closure that accepts a position and a chunk size. Returns a
Data
chunk.consumer
A closure that processes the result of the decompress operation.
Return Value
The checksum of the processed content.