init(toBuffer:capacity:)
Returns an initialized output stream that can write to a provided buffer.
Declaration
init(toBuffer buffer: UnsafeMutablePointer<UInt8>, capacity: Int)Parameters
- buffer:
The buffer the output stream will write to.
- capacity:
The size of the buffer in bytes.
Return Value
An initialized output stream that can write to buffer.
Discussion
The stream must be opened before it can be used.
When the number of bytes written to buffer has reached capacity, the stream’s streamStatus will return NSStreamStatusAtEnd.