---
title: "decompressionStream(readingFrom:flags:threadCount:)"
framework: applearchive
role: symbol
role_heading: Type Method
path: "applearchive/archivebytestream/decompressionstream(readingfrom:flags:threadcount:)"
---

# decompressionStream(readingFrom:flags:threadCount:)

Creates a decompression sequential input stream.

## Declaration

```swift
static func decompressionStream(readingFrom compressedStream: ArchiveByteStream, flags: ArchiveFlags = [], threadCount: Int = 0) -> ArchiveByteStream?
```

## Parameters

- `compressedStream`: An input stream that provides compressed data, the operation only calls doc://com.apple.applearchive/documentation/AppleArchive/ArchiveByteStreamProtocol/read(into:) and doc://com.apple.applearchive/documentation/AppleArchive/ArchiveByteStreamProtocol/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.

## Return Value

Return Value A new archive byte stream.

## See Also

### Decompressing Data

- [withDecompressionStream(readingFrom:flags:threadCount:_:)](applearchive/archivebytestream/withdecompressionstream(readingfrom:flags:threadcount:_:).md)
- [randomAccessDecompressionStream(readingFrom:allocationLimit:flags:threadCount:)](applearchive/archivebytestream/randomaccessdecompressionstream(readingfrom:allocationlimit:flags:threadcount:).md)
- [withRandomAccessDecompressionStream(readingFrom:allocationLimit:flags:threadCount:_:)](applearchive/archivebytestream/withrandomaccessdecompressionstream(readingfrom:allocationlimit:flags:threadcount:_:).md)
