unref_to_array
Description:
Unreferences the bytes, and returns a new mutable [struct@GLib.
ByteArray] containing the same byte data.
As an optimization, the byte data is transferred to the array without copying if this was the last reference to this and this was created with [ctor@GLib.Bytes.new], [ctor@GLib.Bytes.new_take] or [ func@GLib.ByteArray.free_to_bytes] and the buffer was larger than the size [struct@GLib.Bytes] may internalize within its allocation. In all other cases the data is copied.
Do not use it if this contains more than g_maxuint bytes. [ struct@GLib.ByteArray] stores the length of its data in `guint`, which may be shorter than `gsize`, that this is using.
Parameters:
| bytes |
a [struct@GLib.Bytes] |
Returns:
|
a new mutable [struct@GLib.ByteArray] containing the same byte data |