---
title: close()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/stream/close()
---

# close()

Closes the receiver.

## Declaration

```swift
func close()
```

## Discussion

Discussion Closing the stream terminates the flow of bytes and releases system resources that were reserved for the stream when it was opened. If the stream has been scheduled on a run loop, closing the stream implicitly removes the stream from the run loop. A stream that is closed can still be queried for its properties.

## See Also

### Using Streams

- [open()](foundation/stream/open().md)
