<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Stream/getBoundStreams(withBufferSize:inputStream:outputStream:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSStream(cm)getBoundStreamsWithBufferSize:inputStream:outputStream:"
  },
  "title" : "getBoundStreams(withBufferSize:inputStream:outputStream:)"
}
-->

# getBoundStreams(withBufferSize:inputStream:outputStream:)

Creates and returns by reference a bound pair of input and output streams.

```
class func getBoundStreams(withBufferSize bufferSize: Int, inputStream: AutoreleasingUnsafeMutablePointer<InputStream?>?, outputStream: AutoreleasingUnsafeMutablePointer<OutputStream?>?)
```

## Parameters

`bufferSize`

The size of the buffer, in bytes, used to transfer data from `inputStream` to `outputStream`.

`inputStream`

On return, contains an input stream.

`outputStream`

On return, contains an output stream.

## Discussion

The created streams are bound to one another, such that any data written to `outputStream` is received by `inputStream`.

This is a convenience method for calling <doc://com.apple.documentation/documentation/CoreFoundation/CFStreamCreateBoundPair(_:_:_:_:)> and bridging from the returned Core Foundation types.

## See Also

  <doc://com.apple.documentation/documentation/CoreFoundation/CFStreamCreateBoundPair(_:_:_:_:)>



---

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)