Parse hex digits, and use the resultant size to modulate requests for incoming data. A chunk size of 0 terminates the stream, so to read any trailing headers you'll need to provide a delegate handler for receiving those
Prefix each block of data with its length (in hex digits) and add appropriate \r\n sequences. To commit the stream you'll need to use the terminate() function and optionally provide it with a callback for writing trailing headers