Contents

withCompressionStream(using:writingTo:blockSize:flags:threadCount:_:)

Calls the given closure with a compression sequential output stream.

Declaration

static func withCompressionStream<E>(using compressionAlgorithm: ArchiveCompression, writingTo compressedStream: ArchiveByteStream, blockSize: Int = (1<<20), flags: ArchiveFlags = [], threadCount: Int = 0, _ body: (ArchiveByteStream) throws -> E) throws -> E

Parameters

  • compressionAlgorithm:

    The compression algorithm.

  • compressedStream:

    An output stream that receives compressed data, the operation only calls write methods.

  • blockSize:

    The compression block size, in bytes.

  • flags:

    Flags that control the behavior of the operation.

  • threadCount:

    The number of worker threads that the operation uses, set to 0 for default.

  • body:

    A closure with the archive byte stream passed as a parameter.

Return Value

The result of the closure.

See Also

Compressing Data