compression_stream_init(_:_:_:)
Initializes a compression stream for either compression or decompression.
Declaration
func compression_stream_init(_ stream: UnsafeMutablePointer<compression_stream>, _ operation: compression_stream_operation, _ algorithm: compression_algorithm) -> compression_statusParameters
- stream:
Pointer to an allocated Compression_stream structure.
- operation:
A constant of type Compression_stream_operation used to indicate the stream operation.
- algorithm:
A constant of type Compression_algorithm to select the algorithm: Compression_lz4, Compression_zlib, Compression_lzma, or Compression_lzfse.
Return Value
A value of type compression_status, interpreted as follows:
COMPRESSION_STATUS_OK means the stream object was successfully initialized.
COMPRESSION_STATUS_ERROR means an error occurred.
Discussion
After success of this function, set the dst_ptr, dst_size, src_ptr, and src_size fields of the stream structure to their respective values. You can then pass stream structure to the compression_stream_process(_:_:) function.