Bytes.this

Creates a #GBytes from @data.

When the last reference is dropped, @free_func will be called with the @user_data argument.

@data must not be modified after this call is made until @free_func has been called to indicate that the bytes is no longer in use.

@data may be %NULL if @size is 0.

  1. this(GBytes* gBytes)
  2. this(ubyte[] data)
  3. this(void[] data, GDestroyNotify freeFunc, void* userData)
    class Bytes

Parameters

data void[]

the data to be used for the bytes

freeFunc GDestroyNotify

the function to call to release the data

userData void*

data to pass to @free_func

Return: a new #GBytes

Throws

ConstructionException GTK+ fails to create the object.

Meta

Since

2.32