![]() |
![]() |
![]() |
GIO Reference Manual | ![]() |
---|---|---|---|---|
#include <gio.h> GMemoryInputStream; GInputStream* g_memory_input_stream_from_data (const void *data, gssize len); void g_memory_input_stream_set_free_data (GMemoryInputStream *stream, gboolean free_data); const void* g_memory_input_stream_get_data (GMemoryInputStream *stream); gsize g_memory_input_stream_get_data_size (GMemoryInputStream *stream);
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_from_data (const void *data, gssize len);
Creates a new GMemoryInputStream with data in memory of a given size.
|
input data. |
|
length of the data. |
Returns : |
new GInputStream read from data of len bytes.
|
void g_memory_input_stream_set_free_data (GMemoryInputStream *stream, gboolean free_data);
Sets if the data within the stream
should be freed when the stream
is freed.
|
a GMemoryInputStream. |
|
a gboolean. If TRUE , frees the data within stream .
|
const void* g_memory_input_stream_get_data (GMemoryInputStream *stream);
Gets a pointer to the data within the GMemoryInputStream.
|
a GMemoryInputStream |
Returns : |
a pointer to the memory in the stream .
|
gsize g_memory_input_stream_get_data_size (GMemoryInputStream *stream);
Gets the size of the data within the GMemoryInputStream.
|
a GMemoryInputStream |
Returns : |
a gsize with the size of the data in stream .
|