g_bytes_get_data (
  GBytes* bytes,
  gsize* size


Get the byte data in the GBytes. This data should not be modified.

This function will always return the same pointer for a given GBytes.

NULL may be returned if size is 0. This is not guaranteed, as the GBytes may represent an empty string with data non-NULL and size as 0. NULL will not be returned if size is non-zero.

Available since:2.32


size gsize*

Location to return size of byte data.

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

Return value

Returns: An array of guint8
     a pointer to the byte data, or `NULL`.
 The length of the array is in the size argument.