MCPcopy Create free account
hub / github.com/catboost/catboost / Compress

Method Compress

library/cpp/neh/https.cpp:1534–1550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1532
1533 private:
1534 bool Compress(TData& data) const {
1535 if (CompressionScheme_ == TStringBuf("gzip")) {
1536 try {
1537 TData gzipped(data.size());
1538 TMemoryOutput out(gzipped.data(), gzipped.size());
1539 TZLibCompress c(&out, ZLib::GZip);
1540 c.Write(data.data(), data.size());
1541 c.Finish();
1542 gzipped.resize(out.Buf() - gzipped.data());
1543 data.swap(gzipped);
1544 return true;
1545 } catch (yexception&) {
1546 // gzipped data occupies more space than original data
1547 }
1548 }
1549 return false;
1550 }
1551
1552 private:
1553 TIntrusivePtr<TSslServerIOStream> IO_;

Callers

nothing calls this directly

Calls 7

sizeMethod · 0.45
dataMethod · 0.45
WriteMethod · 0.45
FinishMethod · 0.45
resizeMethod · 0.45
BufMethod · 0.45
swapMethod · 0.45

Tested by

no test coverage detected