Bytes.take


Description:

public Bytes.take (owned uint8[] data)

Creates a new Bytes from data.

After this call, data belongs to the bytes and may no longer be modified by the caller. g_free will be called on data when the bytes is no longer in use. Because of this data must have been created by a call to malloc, malloc0 or realloc or by one of the many functions that wrap these calls (such as g_new, BusName, etc) .

For creating Bytes with memory from other allocators, see new_with_owner.

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 Bytes