Skip to content

How to effectively store binary data? #898

Description

@rexdf

I have a data , uint8_t my_data[26] which I want to put in json object once and fetch it quite frequently. There is no need to dump the json object.

I try to convert it to std::string and it does not work(rapidjson seems ok). Casting to and from std::vector seems quite expensive. I also need the lifecycle of the my_data is same as the json object. Is there a better way to solve it?

I thought that maybe I could get the std::string::data() or std::vector::data() directly from json object but I could not find the right way.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions