istream_consume()

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

istream

istream_h

The input stream handle managing the internal gbuffer.

bf

char *

Pointer to the buffer containing the data to be consumed.

len

size_t

The number of bytes available in bf to be consumed.


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