|  |  |  | GIO Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Implemented Interfaces | ||||
#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);
GInputStream *      g_memory_input_stream_new_from_bytes
                                                        (GBytes *bytes);
void                g_memory_input_stream_add_data      (GMemoryInputStream *stream,
                                                         const void *data,
                                                         gssize len,
                                                         GDestroyNotify destroy);
void                g_memory_input_stream_add_bytes     (GMemoryInputStream *stream,
                                                         GBytes *bytes);
GMemoryInputStream is a class for using arbitrary memory chunks as input for GIO streaming input operations.
As of GLib 2.34, GMemoryInputStream implements GPollableInputStream.
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.
| 
 | input data. [array length=len][element-type guint8][transfer full] | 
| 
 | length of the data, may be -1 if datais a nul-terminated string | 
| 
 | function that is called to free data, orNULL. [allow-none] | 
| Returns : | new GInputStream read from dataoflenbytes. | 
GInputStream *      g_memory_input_stream_new_from_bytes
                                                        (GBytes *bytes);
Creates a new GMemoryInputStream with data from the given bytes.
| 
 | a GBytes | 
| Returns : | new GInputStream read from bytes | 
Since 2.34
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
| 
 | a GMemoryInputStream | 
| 
 | input data. [array length=len][element-type guint8][transfer full] | 
| 
 | length of the data, may be -1 if datais a nul-terminated string | 
| 
 | function that is called to free data, orNULL. [allow-none] | 
void g_memory_input_stream_add_bytes (GMemoryInputStream *stream,GBytes *bytes);
Appends bytes to data that can be read from the input stream.
| 
 | a GMemoryInputStream | 
| 
 | input data | 
Since 2.34