CGDataConsumerPutBytesCallback
Copies data from a Core Graphics-supplied buffer into a data consumer.
Declaration
typealias CGDataConsumerPutBytesCallback = (UnsafeMutableRawPointer?, UnsafeRawPointer, Int) -> IntParameters
- info:
A generic pointer to private data shared among your callback functions. This is the pointer supplied to Init(info:cbks:).
- buffer:
The buffer from which you copy the specified number of bytes.
- count:
The number of bytes to copy.
Return Value
The number of bytes copied. If no more data can be written to the consumer, you should return 0.
Discussion
When Core Graphics is ready to send data to the consumer, your function is called. It should copy the specified number of bytes from buffer into some resource under your control—for example, a file.
For information on how to associate your callback function with a data consumer, see init(info:cbks:) and CGDataConsumerCallbacks.