data source; non-const since it may be used as a modifiable context by the function defined in func

size

number of bytes to write

*func

generic write function; the first parameter is src, the second is dest_buf, the third is dest_buf_size. func must return the number of bytes written to dest_buf, or <= 0 to indicate no more data available to write. If func is NULL, src is interpreted as a simple byte array for source data.