Unpack_sequence
implements a way to take an unpack_one
function that can unpack a
value from a character buffer, and use it to unpack a sequence of packed values
coming via a string pipe into a pipe of upacked values.
unpack_from_string_pipe unpack_buffer input
returns (output, result)
, and uses
unpack_buffer
to unpack values from input
until input
is closed. It puts the
unpacked values into output
, which is closed once unpacking finishes, normally
or due to an error. result
indicates why unpacking finished.
unpack_from_reader
and unpack_bin_prot_from_reader
are similar. They are more
efficient in that they blit bytes directly from the reader buffer to the unpack
buffer, without any intervening allocation.