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 [gio.pollable_output_stream.PollableOutputStream]: it always polls as ready.

Methods
GType _gType() @property
MemoryOutputStream self()Returns `this`, for use in `with` statements.
MemoryOutputStreamGidBuilder builder()Get builder for [gio.memoryoutputstream.MemoryOutputStream] Returns: New builder object
void * data() @propertyGet `data` property. Returns: Pointer to buffer where data will be written.
gulong dataSize() @propertyGet `dataSize` property. Returns: Size of data written to the buffer.
gulong size() @propertyGet `size` property. Returns: Current size of the data buffer.
gio.memory_output_stream.MemoryOutputStream newResizable()Creates a new #GMemoryOutputStream, using [glib.global.realloc] and [glib.global.gfree] for memory allocation. Returns:
void * getData()Gets any loaded data from the ostream.
size_t getDataSize()Returns 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()Gets the size of the currently allocated data area (available from [gio.memoryoutputstream.MemoryOutputStream.getData]).
glib.bytes.Bytes stealAsBytes()Returns data from the ostream as a #GBytes. ostream must be closed before calling this function. Returns: the stream's data
void * stealData()Gets 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)
Methods
T data(void * propval)Set `data` property. Params: propval = Pointer to buffer where data will be written. Returns: Builder instance for fluent chaining
T size(gulong propval)Set `size` property. Params: propval = Current size of the data buffer. Returns: Builder instance for fluent chaining

Fluent builder for [gio.memory_output_stream.MemoryOutputStream]