Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: MemoryOutputStreamMeta

[173:14] static extends: object

Generated metadata helpers for MemoryOutputStream class surfaces.

Methods

  • properties ()

    Returns property metadata for MemoryOutputStream.

    • @r A list.

class: MemoryOutputStream

[15:7] extends: object

GMemoryOutputStream is a class for using arbitrary memory chunks as output for GIO streaming output operations. As of GLib 2.34, GMemoryOutputStream trivially implements [iface@Gio.PollableOutputStream]: it always polls as ready.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • MemoryOutputStream ()

    Creates a new #GMemoryOutputStream, using g_realloc() and g_free() for memory allocation.

  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asOutputStream ()

    Wraps this handle as OutputStream.

    • @r A OutputStream object.
  • asPollableOutputStream ()

    Wraps this handle as PollableOutputStream.

    • @r A PollableOutputStream object.
  • asSeekable ()

    Wraps this handle as Seekable.

    • @r A Seekable object.
  • get_data ()

    Gets any loaded data from the @ostream. Note that the returned pointer may become invalid on the next write or truncate operation on the stream.

  • get_data_size ()

    Returns the number of bytes from the start up to including the last byte written in the stream that has not been truncated away.

  • get_size ()

    Gets the size of the currently allocated data area (available from g_memory_output_stream_get_data()). You probably don't want to use this function on resizable streams. See g_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 %G_IO_ERROR_NO_SPACE. In any case, if you want the number of bytes currently written to the stream, use g_memory_output_stream_get_data_size().

  • steal_as_bytes ()

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

  • steal_data ()

    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:destroy-function property. @ostream must be closed before calling this function.