Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GMemoryInputStream

[14:7] extends: object

GMemoryInputStream is a class for using arbitrary memory chunks as input for GIO streaming input operations. As of GLib 2.34, GMemoryInputStream implements [iface@Gio.PollableInputStream].

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GMemoryInputStream (Handle = null)

    Creates a new empty #GMemoryInputStream.

    • @p Handle is an optional native handle or wrapper whose handle to adopt; when the native constructor is called.
  • 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.
  • asInputStream ()

    Wraps this handle as GInputStream.

    • @r A GInputStream object.
  • asPollableInputStream ()

    Wraps this handle as GPollableInputStream.

    • @r A GPollableInputStream object.
  • asSeekable ()

    Wraps this handle as GSeekable.

    • @r A GSeekable object.
  • add_bytes (object bytes)

    Appends @bytes to data that can be read from the input stream.

    • @p bytes is input data.
    • @r None.
  • add_data (list data, object destroy)

    Appends @data to data that can be read from the input stream

    • @p data is input data.
    • @p len is length of the data, may be -1 if @data is a nul-terminated string.
    • @p destroy is function that is called to free @data, or %NULL.
    • @r None.

class: GMemoryInputStreamCtors

[149:14] static extends: object

Alternate constructors for GMemoryInputStream. Usage: GMemoryInputStreamCtors.<name>(...). The primary constructor lives directly on GMemoryInputStream.

Methods

  • newFromBytes (object bytes)

    Creates a new #GMemoryInputStream with data from the given @bytes.

    • @p bytes is a #GBytes.
    • @r A new GMemoryInputStream.
  • newFromData (list data, object destroy)

    Creates a new #GMemoryInputStream with data in memory of a given size.

    • @p data is input data.
    • @p len is length of the data, may be -1 if @data is a nul-terminated string.
    • @p destroy is function that is called to free @data, or %NULL.
    • @r A new GMemoryInputStream.