istream_consume()
#
istream_consume()
reads data from the provided buffer and appends it to the internal gbuffer of the given istream_h
instance until a specified delimiter or byte count is reached.
Prototype
size_t istream_consume(
istream_h istream,
char *bf,
size_t len
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The input stream handle managing the internal gbuffer. |
|
|
Pointer to the buffer containing the data to be consumed. |
|
|
The number of bytes available in |
Return Value
Returns the number of bytes successfully consumed from bf
and appended to the internal gbuffer.
Notes
If the istream
is configured to read until a delimiter, it will check for the delimiter sequence in the accumulated data. If configured to read a fixed number of bytes, it will stop once the required amount is reached. If the delimiter or byte count is reached, the function triggers the configured event.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples