It derives from <GOutputStream>.
<GMemoryOutputStream> is a class for
using arbitrary memory chunks as output for GIO streaming output
operations.
As of GLib 2.34, <GMemoryOutputStream>
trivially implements
<GPollableOutputStream>: it always
polls as ready.
parent-instancePointer to buffer where data will be written.
Its value is a foreign pointer (or, to set it, a bytevector).
It can only be set when the object is made, with #:data.
Size of data written to the buffer.
Its value is an unsigned 64-bit integer.
It is read only.
Current size of the data buffer.
Its value is an unsigned 64-bit integer.
It can only be set when the object is made, with #:size.
Gets any loaded data from the self.
Note that the returned pointer may become invalid on the next write or truncate operation on the stream.
Passed: a <GMemoryOutputStream>.
Returned: a foreign pointer, or #f.
pointer to the stream’s data, or #f if the data has been stolen
Returns the number of bytes from the start up to including the last byte written in the stream that has not been truncated away.
Passed: a <GMemoryOutputStream>.
Returned: an unsigned 64-bit integer.
the number of bytes written to the stream
Gets the size of the currently allocated data area (available from
memory-output-stream:get-data).
You probably don’t want to use this function on resizable streams. See
memory-output-stream:get-data-size instead. For
resizable streams the size returned by this function is an
implementation detail and may be change at any time in response to
operations on the stream.
If the stream is fixed-sized (ie: no realloc was passed to
g_memory_output_stream_new()) then this is the maximum size of
the stream and further writes will return
no-space.
In any case, if you want the number of bytes currently written to the
stream, use memory-output-stream:get-data-size.
Passed: a <GMemoryOutputStream>.
Returned: an unsigned 64-bit integer.
the number of bytes allocated for the data buffer
Creates a new <GMemoryOutputStream>,
using realloc and
byte-array:free for memory allocation.
Returned: a <GOutputStream>.
Returns data from the self as a <GBytes>.
self must be closed before calling this function.
Passed: a <GMemoryOutputStream>.
Returned: a <GBytes>.
the stream’s data
Gets any loaded data from the self. Ownership of the data is
transferred to the caller; when no longer needed it must be freed using
the free function set in self’s destroy-function property.
self must be closed before calling this function.
Passed: a <GMemoryOutputStream>.
Returned: a foreign pointer, or #f.
the stream’s data, or #f if it has previously been stolen