MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / copy_block

Function copy_block

zlib/trees.c:1197–1219  ·  view source on GitHub ↗

=========================================================================== * Copy a stored block, storing first the length and its * one's complement if requested. */

(s, buf, len, header)

Source from the content-addressed store, hash-verified

1195 * one's complement if requested.
1196 */
1197local void copy_block(s, buf, len, header)
1198 deflate_state *s;
1199 charf *buf; /* the input data */
1200 unsigned len; /* its length */
1201 int header; /* true if block header must be written */
1202{
1203 bi_windup(s); /* align on byte boundary */
1204 s->last_eob_len = 8; /* enough lookahead for inflate */
1205
1206 if (header) {
1207 put_short(s, (ush)len);
1208 put_short(s, (ush)~len);
1209#ifdef DEBUG
1210 s->bits_sent += 2*16;
1211#endif
1212 }
1213#ifdef DEBUG
1214 s->bits_sent += (ulg)len<<3;
1215#endif
1216 while (len--) {
1217 put_byte(s, *buf++);
1218 }
1219}

Callers 1

_tr_stored_blockFunction · 0.85

Calls 1

bi_windupFunction · 0.85

Tested by

no test coverage detected