---
title: close()
framework: applearchive
role: symbol
role_heading: Instance Method
path: applearchive/archivebytestreamprotocol/close()
---

# close()

Closes the stream and releases associated resources.

## Declaration

```swift
func close() throws
```

## Discussion

Discussion After calling 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.

## See Also

### Using Archive Byte Streams

- [seek(toOffset:relativeTo:)](applearchive/archivebytestreamprotocol/seek(tooffset:relativeto:).md)
- [cancel()](applearchive/archivebytestreamprotocol/cancel().md)
