free_to_bytes


Description:

[ Version ( since = "2.32" ) ]
public static Bytes free_to_bytes (owned ByteArray array)

Transfers the data from the `GByteArray` into a new immutable [struct@GLib.

Bytes].

The `GByteArray` is freed unless the reference count of array is greater than one, in which the `GByteArray` wrapper is preserved but the size of array will be set to zero.

This is identical to using [ctor@GLib.Bytes.new_take] and [func@GLib.ByteArray.free] together.

Parameters:

array

a byte array

Returns:

The new immutable [struct@GLib.Bytes] representing same byte data that was in the array