# DeviceAtlas C API JSONConverter #
The JSONConverter tool converts the Device Atlas JSON data file into a binary format data file.
The benefit of using the binary data file is a reduction in initial data file load time into the API.
### Usage ###
```shell
unix systems.
% ExtraTools/JsonConverter/jsonconverter -j -b
```
```cmd
windows systems.
% ExtraTools\JsonConverter\jsonconverter.exe -j -b
```
### Programmatically ###
It is possible to dump the JSON data into a binary and/or read from it
```c
// Dumping
...
const char *binaryPath = "./data.bin"; // readable/writable path
void *bin;
size_t binlen;
if ((status = da_atlas_dump_mapped(binarypath, &bin, &binlen, ptr, size)) != DA_OK)
{
fprintf(stderr, "da_atlas_dump_mapped failed\n");
goto daclose;
}
...
// Reading from the binary from above or from in RAM data
void *m;
if ((status = da_atlas_read_mapped(binarypath, m, &ptr, &size)) != DA_OK)
{
fprintf(stderr, "da_atlas_read_mapped failed\n");
goto daclose;
}
```
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_ Copyright (c) DeviceAtlas Limited 2021. All Rights Reserved. _
https://deviceatlas.com