MemoryOutputStream.getSize

size_t getSize()

Gets the size of the currently allocated data area (available from [gio.memory_output_stream.MemoryOutputStream.getData]).

You probably don't want to use this function on resizable streams. See [gio.memory_output_stream.MemoryOutputStream.getDataSize] 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.memory_output_stream.MemoryOutputStream.new_]) then this is the maximum size of the stream and further writes will return [gio.types.IOErrorEnum.NoSpace].

In any case, if you want the number of bytes currently written to the stream, use [gio.memory_output_stream.MemoryOutputStream.getDataSize].

Returns

the number of bytes allocated for the data buffer