function read_buf(strm, buf, start, size) {
  let len = strm.avail_in;
  if (len > size) len = size;
  if (len === 0) return 0;
  strm.avail_in -= len;
  // zmemcpy(buf, strm->next_in, len);
  buf.set(strm.input.subarray(strm.next_in, strm.next_in + len), start);
  if (strm.state.wrap === 1) {
    strm.adler = adler32(strm.adler, buf, len, start);
  } else if (strm.state.wrap === 2) {
    strm.adler = crc32(strm.adler, buf, len, start);
  }
  strm.next_in += len;
  strm.total_in += len;
  return len;
}
/* ===========================================================================
 * Read a new buffer from the current input stream, update the adler32
 * and total number of bytes read.  All deflate() input goes through
 * this function so some applications may wish to modify it to avoid
 * allocating a large strm->input buffer and copying from it.
 * (See also flush_pending()).
 */
Read a new buffer from the current input stream, update the adler32
and total number of bytes read.  All deflate() input goes through
this function so some applications may wish to modify it to avoid
allocating a large strm->input buffer and copying from it.
Read a new buffer from the current input stream update the adler32 and total number of bytes read . All deflate () input goes through this function so some applications may wish to modify it to avoid allocating a large strm - > input buffer and copying from it .
function read_buf(strm, buf, start, size) {
  let len = strm.avail_in;
  if (len > size) len = size;
  if (len === 0) return 0;
  strm.avail_in -= len;
  buf.set(strm.input.subarray(strm.next_in, strm.next_in + len), start);
  if (strm.state.wrap === 1) {
    strm.adler = adler32(strm.adler, buf, len, start);
  } else if (strm.state.wrap === 2) {
    strm.adler = crc32(strm.adler, buf, len, start);
  }
  strm.next_in += len;
  strm.total_in += len;
  return len;
}
function read_buf ( strm , buf , start , size ) { let len = strm . avail_in ; if ( len > size ) len = size ; if ( len === 0 ) return 0 ; strm . avail_in -= len ; buf . set ( strm . input . subarray ( strm . next_in , strm . next_in + len ) , start ) ; if ( strm . state . wrap === 1 ) { strm . adler = adler32 ( strm . adler , buf , len , start ) ; } else if ( strm . state . wrap === 2 ) { strm . adler = crc32 ( strm . adler , buf , len , start ) ; } strm . next_in += len ; strm . total_in += len ; return len ; }
Read a new buffer from the current input stream, update the adler32
 and total number of bytes read.
Read a new buffer from the current input stream update the adler32 and total number of bytes read .
// zmemcpy(buf, strm->next_in, len);