withRandomAccessDecompressionStream(readingFrom:allocationLimit:flags:threadCount:_:)
Calls the given closure with a decompression random access input stream.
Declaration
static func withRandomAccessDecompressionStream<E>(readingFrom compressedStream: ArchiveByteStream, allocationLimit: Int = Int.max, flags: ArchiveFlags = [], threadCount: Int = 0, _ body: (ArchiveByteStream) throws -> E) throws -> EParameters
- compressedStream:
An input stream that provides compressed data.
- allocationLimit:
The requested memory allocation size, in bytes. Set to
0for lowest memory footprint or Max for best performance. - flags:
Flags that control the behavior of the operation.
- threadCount:
The number of worker threads that the operation uses, set to
0for 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 randomAccessDecompressionStream(readingFrom:allocationLimit:flags:threadCount:), calls the specified closure, and closes the stream.