Class: Gio::MemoryOutputStream

Inherits:
OutputStream show all
Defined in:
(unknown)

Instance Method Summary collapse

Methods inherited from OutputStream

#clear_pending, #close, #close_async, #close_finish, #flush, #flush_async, #flush_finish, #has_pending, #is_closed, #is_closing, open, #printf, #set_pending, #splice, #splice_async, #splice_finish, #vprintf, #write, #write_all, #write_all_async, #write_all_finish, #write_async, #write_bytes, #write_bytes_async, #write_bytes_finish, #write_finish, #writev, #writev_all, #writev_all_async, #writev_all_finish, #writev_async, #writev_finish

Constructor Details

#initializeGio::OutputStream

Creates a new GMemory::OutputStream, using g_realloc() and g_free() for memory allocation.

Instance Method Details

#dataGObject

Pointer to buffer where data will be written.

Returns:

  • (GObject)

    data

#data=(data) ⇒ GObject

Pointer to buffer where data will be written.

Parameters:

  • data (GObject)

Returns:

  • (GObject)

    data

  • (GObject)

    data

#data_sizeGio::gulong

Size of data written to the buffer.

Returns:

  • (Gio::gulong)

    data-size

#data_size=(data_size) ⇒ Gio::gulong

Size of data written to the buffer.

Parameters:

  • data_size (Gio::gulong)

Returns:

  • (Gio::gulong)

    data-size

  • (Gio::gulong)

    data-size

#destroy_functionGObject

Function called with the buffer as argument when the stream is destroyed.

Returns:

  • (GObject)

    destroy-function

#destroy_function=(destroy_function) ⇒ GObject

Function called with the buffer as argument when the stream is destroyed.

Parameters:

  • destroy_function (GObject)

Returns:

  • (GObject)

    destroy-function

  • (GObject)

    destroy-function

#realloc_functionGObject

Function with realloc semantics called to enlarge the buffer.

Returns:

  • (GObject)

    realloc-function

#realloc_function=(realloc_function) ⇒ GObject

Function with realloc semantics called to enlarge the buffer.

Parameters:

  • realloc_function (GObject)

Returns:

  • (GObject)

    realloc-function

  • (GObject)

    realloc-function

#sizeGio::gulong

Current size of the data buffer.

Returns:

  • (Gio::gulong)

    size

#size=(size) ⇒ Gio::gulong

Current size of the data buffer.

Parameters:

  • size (Gio::gulong)

Returns:

  • (Gio::gulong)

    size

  • (Gio::gulong)

    size

#steal_as_bytesGLib::Bytes

Returns data from the ostream as a #GBytes. ostream must be closed before calling this function.

Returns:

  • (GLib::Bytes)

    the stream's data

#steal_dataGObject

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 GMemory::OutputStream:destroy-function property.

ostream must be closed before calling this function.

Returns:

  • (GObject)

    the stream's data, or nil if it has previously been stolen