### Function

# GLib ByteArray steal

since: 2.64

#### 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`

  Type: An array of `guint8`

  A `GByteArray`.

  The data is owned by the caller of the function.

`len`

  Type: `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`.

#### Return value

Type: `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.