Bytes.take


Description:

public Bytes.take (owned uint8[]? data)

Creates a new [struct@GLib.

Bytes] from data.

After this call, data belongs to the `GBytes` and may no longer be modified by the caller. The memory of data has to be dynamically allocated and will eventually be freed with [func@GLib.free].

For creating `GBytes` with memory from other allocators, see [ctor@GLib.Bytes.new_with_free_func].

data may be `NULL` if data.length is 0.

Parameters:

data

the data to be used for the bytes

size

the size of data

Returns:

a new [struct@GLib.Bytes]