Vips.Target.steal

### Method

# Vips Targetsteal

#### Declaration [src]

    unsigned char*
    vips_target_steal (
      VipsTarget* target,
      size_t* length
    )

#### Description [src]

Memory targets only (see `vips_target_new_to_memory()`). Steal all data written to the target so far, and call `vips_target_end()`.

You must free the returned pointer with `g_free()`.

The data is NOT automatically null-terminated. Use `vips_target_putc()` with a ‘\0’ before calling this to get a null-terminated string.

You can’t call this after `vips_target_end()`, since that moves the data to a blob, and we can’t steal from that in case the pointer has been shared.

You can’t call this function more than once.

#### Parameters

`length`

  Type: `size_t*`

  Return number of bytes of data.

  The argument will be set by the function.

#### Return value

Type: An array of `guint8`

The data.

The length of the array is in the `length` argument.
The caller of the method takes ownership of the returned data, and is responsible for freeing it.