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

Function WritePart

util/stream/zlib.cpp:244–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242 }
243
244 inline const Bytef* WritePart(const Bytef* b, const Bytef* e) {
245 Z()->next_in = const_cast<Bytef*>(b);
246 Z()->avail_in = MaxPortion(e - b);
247
248 while (Z()->avail_in) {
249 const int ret = deflate(Z(), Z_NO_FLUSH);
250
251 switch (ret) {
252 case Z_OK:
253 continue;
254
255 case Z_BUF_ERROR:
256 FlushBuffer();
257
258 break;
259
260 default:
261 ythrow TZLibCompressorError() << "deflate error(" << GetErrMsg() << ")";
262 }
263 }
264
265 return Z()->next_in;
266 }
267
268 inline void Flush() {
269 int ret = deflate(Z(), Z_SYNC_FLUSH);

Callers 1

Calls 3

MaxPortionFunction · 0.85
deflateFunction · 0.85
FlushBufferFunction · 0.85

Tested by

no test coverage detected