<!--
{
  "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/ArchiveByteStreamProtocol/close()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Apple Archive"
    ],
    "preciseIdentifier" : "s:12AppleArchive0B18ByteStreamProtocolP5closeyyKF"
  },
  "title" : "close()"
}
-->

# close()

Closes the stream and releases associated resources.

```
func close() throws
```

## Discussion

After calling [`close()`](/documentation/AppleArchive/ArchiveByteStreamProtocol/close()), expect that subsequent function calls on the stream to trigger a runtime error.

You must close all opened streams, otherwise deinitialization causes a runtime error.

---

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)