nlohmann::basic_json::to_ubjson

create a UBJSON serialization of a given JSON value

Synopsis

Declared in <nlohmann/json.hpp>

static
std::vector<uint8_t>
to_ubjson(
    basic_json const& j,
    bool const use_size = false,
    bool const use_type = false);

Return Value

a UBJSON serialization of j as a byte vector

Parameters

NameDescription
jJSON value to serialize
use_sizewhether to add size annotations to container types
use_typewhether to add type annotations to container types (must be combined with use_size = true)