Function

GLibByteArraysteal

Declaration

guint8*
g_byte_array_steal (
  GByteArray* array,
  gsize* len
)

Description

Frees the data in the array and resets the size to zero, while the underlying array is preserved for use elsewhere and returned to the caller.

Available since:2.64

Parameters

array An array of guint8
 

A GByteArray.

 The data is owned by the caller of the function.
len gsize*
 

Pointer to retrieve the number of elements of the original array.

 The argument will be set by the function.
 The argument can be NULL.
 The called function takes ownership of the data, and is responsible for freeing it.

Return value

Returns: guint8
 

The element data, which should be freed using g_free().

 The caller of the function takes ownership of the data, and is responsible for freeing it.