code: function zip_send_bits(
    value,	// value to send
    length) {	// number of bits
    /* If not enough room in bi_buf, use (valid) bits from bi_buf and
     * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
     * unused bits in value.
     */
    if (zip_bi_valid > zip_Buf_size - length) {
      zip_bi_buf |= (value << zip_bi_valid);
      zip_put_short(zip_bi_buf);
      zip_bi_buf = (value >> (zip_Buf_size - zip_bi_valid));
      zip_bi_valid += length - zip_Buf_size;
    } else {
      zip_bi_buf |= value << zip_bi_valid;
      zip_bi_valid += length;
    }
  }
docs: bit size of bi_buf