MCPcopy Create free account
hub / github.com/TruthHun/BookStack / read_buf

Function read_buf

static/word2md/mammoth.browser.js:18420–18442  ·  view source on GitHub ↗
(strm, buf, start, size)

Source from the content-addressed store, hash-verified

18418 * (See also flush_pending()).
18419 */
18420function read_buf(strm, buf, start, size) {
18421 var len = strm.avail_in;
18422
18423 if (len > size) { len = size; }
18424 if (len === 0) { return 0; }
18425
18426 strm.avail_in -= len;
18427
18428 // zmemcpy(buf, strm->next_in, len);
18429 utils.arraySet(buf, strm.input, strm.next_in, len, start);
18430 if (strm.state.wrap === 1) {
18431 strm.adler = adler32(strm.adler, buf, len, start);
18432 }
18433
18434 else if (strm.state.wrap === 2) {
18435 strm.adler = crc32(strm.adler, buf, len, start);
18436 }
18437
18438 strm.next_in += len;
18439 strm.total_in += len;
18440
18441 return len;
18442}
18443
18444
18445/* ===========================================================================

Callers 1

fill_windowFunction · 0.70

Calls 2

adler32Function · 0.70
crc32Function · 0.70

Tested by

no test coverage detected