るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.069秒)
トップページ > クエリ:IO.new[x] > クエリ:gets[x] > クエリ:params[x] > クエリ:foreach[x] > クラス:Zlib::Inflate[x]

別のキーワード

  1. openssl new
  2. _builtin new
  3. rexml/document new
  4. resolv new
  5. socket new

ライブラリ

検索結果

Zlib::Inflate#set_dictionary(string) -> String (6113.0)

展開に用いる辞書を指定します。string を返します。 このメソッドは Zlib::NeedDict 例外が発生した直後のみ 有効です。詳細は zlib.h を参照して下さい。

...さい。

@param string 展開に用いる辞書を文字列で指定します。

require 'zlib'

def case2(str, dict)
dez = Zlib::Deflate.new
dez.set_dictionary(dict)
comp_str = dez.deflate(str)
comp_str << dez.finish
comp_str.size
inz = Zlib::Inflate.new
begin...
...inz.inflate(comp_str)
rescue Zlib::NeedDict
end
# 展開に用いる辞書が必要です。
inz.set_dictionary(dict)
p inz.inflate(comp_str)
end
dict = 'hoge_fuga_ugougo'
sset = [ dict, 'taeagbamike', 'ugotagma', 'fugebogya' ]
g = [ 0, 0, 0, 1, 1, 1, 0, 0, 0, 3, 3, 3...