| GIO Reference Manual | ||||
|---|---|---|---|---|
#include <gio/gio.h>
GMemoryInputStream;
GInputStream* g_memory_input_stream_new (void);
GInputStream* g_memory_input_stream_new_from_data (const void *data,
gssize len,
GDestroyNotify destroy);
void g_memory_input_stream_add_data (GMemoryInputStream *stream,
const void *data,
gssize len,
GDestroyNotify destroy);
GMemoryInputStream is a class for using arbitrary memory chunks as input for GIO streaming input operations.
typedef struct _GMemoryInputStream GMemoryInputStream;
Implements GInputStream for arbitrary memory chunks.
GInputStream* g_memory_input_stream_new (void);
Creates a new empty GMemoryInputStream.
| Returns : | a new GInputStream |
GInputStream* g_memory_input_stream_new_from_data (const void *data, gssize len, GDestroyNotify destroy);
Creates a new GMemoryInputStream with data in memory of a given size.
| data : | input data |
| len : | length of the data, may be -1 if data is a nul-terminated string |
| destroy : | function that is called to free data, or NULL |
| Returns : | new GInputStream read from data of len bytes. |
void g_memory_input_stream_add_data (GMemoryInputStream *stream, const void *data, gssize len, GDestroyNotify destroy);
Appends data to data that can be read from the input stream
| stream : | a GMemoryInputStream |
| data : | input data |
| len : | length of the data, may be -1 if data is a nul-terminated string |
| destroy : | function that is called to free data, or NULL |