Push binary contents of file to std::string for use with Google's Snappy

454 views Asked by At

I'm trying to learn Google's c++ compression library Snappy. It requires that data be loaded into an std::string to compress or decompress it. How can I go about opening a file and loading the data into an std::string. Thanks.

1

There are 1 answers

0
Nikita On BEST ANSWER

Check the Unit tests of Snappy library. There is a GetContent function that loads binary data into the string. Also you can check how it's used for data compression there.