MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / compress

Method compress

libCacheSim/traceAnalyzer/utils/include/utilsCompress.h:10–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8class Gzip {
9 public:
10 static std::string compress(const std::string& data)
11 {
12 namespace bio = boost::iostreams;
13
14 std::stringstream compressed;
15 std::stringstream origin(data);
16
17 bio::filtering_streambuf<bio::input> out;
18 out.push(bio::gzip_compressor(bio::gzip_params(bio::gzip::best_compression)));
19 out.push(origin);
20 bio::copy(out, compressed);
21
22 return compressed.str();
23 }
24
25 static std::string decompress(const std::string& data)
26 {

Callers

nothing calls this directly

Calls 1

copyFunction · 0.85

Tested by

no test coverage detected