Contents

withDecompressionStream(readingFrom:flags:threadCount:_:)

Calls the given closure with a decompression sequential input stream.

Declaration

static func withDecompressionStream<E>(readingFrom compressedStream: ArchiveByteStream, flags: ArchiveFlags = [], threadCount: Int = 0, _ body: (ArchiveByteStream) throws -> E) throws -> E

Parameters

  • compressedStream:

    An input stream that provides compressed data, the operation only calls Read(into:) and Read(into:atoffset:).

  • 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.

Discussion

This function opens a stream created by decompressionStream(readingFrom:flags:threadCount:), calls the specified closure, and closes the stream.

See Also

Decompressing Data