<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppleArchive",
  "identifier" : "/documentation/AppleArchive/ArchiveByteStream/decompressionStream(readingFrom:flags:threadCount:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Apple Archive",
      "AppleArchive"
    ],
    "preciseIdentifier" : "s:12AppleArchive0B10ByteStreamC013decompressionD011readingFrom5flags11threadCountACSgAC_AA0B5FlagsVSitFZ"
  },
  "title" : "decompressionStream(readingFrom:flags:threadCount:)"
}
-->

# decompressionStream(readingFrom:flags:threadCount:)

Creates a decompression sequential input stream.

```
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 [`read(into:)`](/documentation/AppleArchive/ArchiveByteStreamProtocol/read(into:)) and [`read(into:atOffset:)`](/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

A new archive byte stream.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)