Function

GLib-2.0GLibbyte_array_new_takeSince 2.32

  • Creates a byte array containing the data. After this call, data belongs to the GLib.ByteArray and may no longer be modified by the caller. The memory of data has to be dynamically allocated and will eventually be freed with GLib.free.

    Do not use it if len is greater than G_MAXUINT. GLib.ByteArray stores the length of its data in guint, which may be shorter than gsize.

    Parameters

    • data: string | Uint8Array<ArrayBufferLike>

      the byte data for the array

    Returns Uint8Array

    The new GLib.ByteArray

    2.32