### Function

# GLib ByteArray new_take

since: 2.32

#### Declaration [src]

    GByteArray*
    g_byte_array_new_take (
      guint8* data,
      gsize len
    )

#### Description [src]

Creates a byte array containing the `data`. After this call, `data` belongs to the `GByteArray` and may no longer be modified by the caller. The memory of `data` has to be dynamically allocated and will eventually be freed with `g_free()`.

Do not use it if `len` is greater than `G_MAXUINT`. `GByteArray` stores the length of its data in `guint`, which may be shorter than `gsize`.

Available since: 2.32

#### Parameters

`data`

  Type: An array of `guint8`

  The byte data for the array.

  The length of the array is specified in the `len` argument.
  The called function takes ownership of the data, and is responsible for freeing it.

`len`

  Type: `gsize`

  The length of `data`.

#### Return value

Type: An array of `guint8`

The new `GByteArray`.

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