---
title: "CFStreamCreateBoundPair(_:_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfstreamcreateboundpair(_:_:_:_:)"
---

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

Creates a bound pair of read and write streams.

## Declaration

```swift
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 doc://com.apple.corefoundation/documentation/CoreFoundation/kCFAllocatorDefault or NULL to use the current default allocator.
- `readStream`: On return, contains a readable stream. Ownership follows the 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 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

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

## See Also

### Related Documentation

- [getBoundStreams(withBufferSize:inputStream:outputStream:)](foundation/stream/getboundstreams(withbuffersize:inputstream:outputstream:).md)

### Creating Streams

- [CFStreamCreatePairWithPeerSocketSignature(_:_:_:_:)](corefoundation/cfstreamcreatepairwithpeersocketsignature(_:_:_:_:).md)
- [CFStreamCreatePairWithSocketToHost(_:_:_:_:_:)](corefoundation/cfstreamcreatepairwithsockettohost(_:_:_:_:_:).md)
- [CFStreamCreatePairWithSocket(_:_:_:_:)](corefoundation/cfstreamcreatepairwithsocket(_:_:_:_:).md)
- [CFStreamCreatePairWithSocketToCFHost(_:_:_:_:_:)](cfnetwork/cfstreamcreatepairwithsockettocfhost(_:_:_:_:_:).md)
- [CFStreamCreatePairWithSocketToNetService(_:_:_:_:)](cfnetwork/cfstreamcreatepairwithsockettonetservice(_:_:_:_:).md)
