lib/ruby/truffle/pr-zlib/lib/pr/rbzlib.rb
# Determine the best encoding for the current block: dynamic trees, static
#  trees or store, and output the encoded block to the zip file.
Determine the best encoding for the current block: dynamic trees, static
trees or store, and output the encoded block to the zip file.
Determine the best encoding for the current block : dynamic trees static trees or store and output the encoded block to the zip file .
def _tr_flush_block(s,buf,stored_len,eof)
    max_blindex = 0
    if (s.level > 0)
      if (stored_len>0 && s.strm.data_type == Z_UNKNOWN)
        set_data_type(s)
      end
      build_tree(s, s.l_desc)
      build_tree(s, s.d_desc)
      max_blindex = build_bl_tree(s)
      opt_lenb = (s.opt_len+3+7) >> 3
      static_lenb = (s.static_len+3+7) >> 3
      if (static_lenb <= opt_lenb)
        opt_lenb = static_lenb
      end
    else
      static_lenb = stored_len + 5
      opt_lenb = static_lenb
    end
    if (stored_len+4 <= opt_lenb) && buf
      _tr_stored_block(s, buf, stored_len, eof)
    elsif (s.strategy == Z_FIXED || static_lenb == opt_lenb)
      send_bits(s, (STATIC_TREES << 1)+(eof ? 1 : 0), 3)
      compress_block(s, @@static_ltree, @@static_dtree)
    else
      send_bits(s, (DYN_TREES << 1)+(eof ? 1 : 0), 3)
      send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1,
                     max_blindex+1)
      compress_block(s, s.dyn_ltree, s.dyn_dtree)
    end
    init_block(s)
    bi_windup(s) if eof
  end
def _tr_flush_block ( s , buf , stored_len , eof ) max_blindex = 0 if ( s . level > 0 ) if ( stored_len > 0 && s . strm . data_type == Z_UNKNOWN ) set_data_type ( s ) end build_tree ( s , s . l_desc ) build_tree ( s , s . d_desc ) max_blindex = build_bl_tree ( s ) opt_lenb = ( s . opt_len + 3 + 7 ) >> 3 static_lenb = ( s . static_len + 3 + 7 ) >> 3 if ( static_lenb <= opt_lenb ) opt_lenb = static_lenb end else static_lenb = stored_len + 5 opt_lenb = static_lenb end if ( stored_len + 4 <= opt_lenb ) && buf _tr_stored_block ( s , buf , stored_len , eof ) elsif ( s . strategy == Z_FIXED || static_lenb == opt_lenb ) send_bits ( s , ( STATIC_TREES << 1 ) + ( eof ? 1 : 0 ) , 3 ) compress_block ( s , @@static_ltree , @@static_dtree ) else send_bits ( s , ( DYN_TREES << 1 ) + ( eof ? 1 : 0 ) , 3 ) send_all_trees ( s , s . l_desc . max_code + 1 , s . d_desc . max_code + 1 , max_blindex + 1 ) compress_block ( s , s . dyn_ltree , s . dyn_dtree ) end init_block ( s ) bi_windup ( s ) if eof end
Determine the best encoding for the current block: dynamic trees, static
trees or store, and output the encoded block to the zip file.
Determine the best encoding for the current block : dynamic trees static trees or store and output the encoded block to the zip file .
s
<not_specific>
buf
<not_specific>
stored_len
<not_specific>
eof
<not_specific>