<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFStreamCreateBoundPair(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFStreamCreateBoundPair"
  },
  "title" : "CFStreamCreateBoundPair(_:_:_:_:)"
}
-->

# CFStreamCreateBoundPair(_:_:_:_:)

Creates a bound pair of read and write streams.

```
func CFStreamCreateBoundPair(_ alloc: CFAllocator!, _ readStream: UnsafeMutablePointer<Unmanaged<CFReadStream>?>!, _ writeStream: UnsafeMutablePointer<Unmanaged<CFWriteStream>?>!, _ transferBufferSize: CFIndex)
```

## Parameters

`alloc`

The allocator to use to allocate memory for the new objects. Pass [`kCFAllocatorDefault`](/documentation/CoreFoundation/kCFAllocatorDefault) or `NULL` to use the current default allocator.

`readStream`

On return, contains a readable stream. Ownership follows the [The Create Rule](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html#//apple_ref/doc/uid/20001148-103029).

`writeStream`

On return, contains a writable stream. Ownership follows the [The Create Rule](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html#//apple_ref/doc/uid/20001148-103029).

`transferBufferSize`

The size of the buffer, in bytes, used to transfer data from `readStream` to `writeStream`.

## Discussion

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

## See Also

  <doc://com.apple.documentation/documentation/Foundation/Stream/getBoundStreams(withBufferSize:inputStream:outputStream:)>



---

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)