Json.Generator.to_data

### Method

# Json Generatorto_data

#### Declaration [src]

    gchar*
    json_generator_to_data (
      JsonGenerator* generator,
      gsize* length
    )

#### Description [src]

Generates a JSON data stream from `generator` and returns it as a buffer.

#### Parameters

`length` | `gsize*`
| Return location for the length of the returned buffer.
| The argument will be set by the function.
| The argument can be `NULL`.

#### Return value

Returns: | `gchar*`
| A newly allocated string holding a JSON data stream.
| The caller of the method takes ownership of the data, and is responsible for freeing it.
| The value is a NUL terminated UTF-8 string.