Once you have set such a callback with oggz_write_set_hungry_callback(), simply call oggz_write() or oggz_write_output() repeatedly, and Oggz will call your callback to provide packets when it is hungry.
This process is illustrated in the following diagram:
The following example code generates a stream of ten packets, each containing a single byte ('A', 'B', ... , 'J'):