gio.memory_output_stream

Module for [MemoryOutputStream] class

Types 3

gio.memory_output_stream.MemoryOutputStream is a class for using arbitrary memory chunks as output for GIO streaming output operations.

As of GLib 2.34, gio.memory_output_stream.MemoryOutputStream trivially implements

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
MemoryOutputStream self() nothrowReturns `this`, for use in `with` statements.
MemoryOutputStreamGidBuilder builder() static nothrowGet builder for [gio.memory_output_stream.MemoryOutputStream] Returns: New builder object
void * data() @property nothrowGet `data` property. Returns: Pointer to buffer where data will be written.
gulong dataSize() @property nothrowGet `dataSize` property. Returns: Size of data written to the buffer.
gulong size() @property nothrowGet `size` property. Returns: Current size of the data buffer.
gio.memory_output_stream.MemoryOutputStream newResizable() static nothrowCreates a new #GMemoryOutputStream, using [glib.global.realloc] and [glib.global.gfree] for memory allocation. Returns:
void * getData() nothrowGets any loaded data from the ostream.
size_t getDataSize() nothrowReturns the number of bytes from the start up to including the last byte written in the stream that has not been truncated away. Returns: the number of bytes written to the stream
size_t getSize() nothrowGets the size of the currently allocated data area (available from [gio.memory_output_stream.MemoryOutputStream.getData]).
glib.bytes.Bytes stealAsBytes() nothrowReturns data from the ostream as a #GBytes. ostream must be closed before calling this function. Returns: the stream's data
void * stealData() nothrowGets any loaded data from the ostream. Ownership of the data is transferred to the caller; when no longer needed it must be freed using the free function set in ostream's #GMemoryOutputStream:destr...
Constructors
this(void * ptr, Flag!"Take" take)

Fluent builder implementation template for gio.memory_output_stream.MemoryOutputStream

Methods
T data(void * propval) nothrowSet `data` property. Params: propval = Pointer to buffer where data will be written. Returns: Builder instance for fluent chaining
T size(gulong propval) nothrowSet `size` property. Params: propval = Current size of the data buffer. Returns: Builder instance for fluent chaining