Function

CFStreamCreateBoundPair(_:_:_:_:)

Creates a bound pair of read and write streams.

Declaration

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 or NULL to use the current default allocator.

readStream

On return, contains a readable stream. Ownership follows the The Create Rule.

writeStream

On return, contains a writable stream. Ownership follows the The Create Rule.

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.