Gio.MemoryOutputStream.prototype.get_size
function get_size(): Number(gsize) { // Gjs wrapper for g_memory_output_stream_get_size() }
Gets the size of the currently allocated data area (available from Gio.MemoryOutputStream.prototype.get_data).
You probably don't want to use this function on resizable streams. See Gio.MemoryOutputStream.prototype.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 Gio.MemoryOutputStream.new) then this is the maximum size of the stream and further writes will return Gio.IOErrorEnum.no_space.
In any case, if you want the number of bytes currently written to the stream, use Gio.MemoryOutputStream.prototype.get_data_size.
- Returns
the number of bytes allocated for the data buffer