るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.179秒)
トップページ > クエリ:i[x] > クエリ:-[x] > クエリ:>[x] > クエリ:d[x] > クエリ:set_dictionary[x]

別のキーワード

  1. _builtin >
  2. bigdecimal >
  3. module >
  4. integer >
  5. complex >

ライブラリ

クラス

検索結果

Zlib::Deflate#set_dictionary(string) -> String (30543.0)

圧縮に用いる辞書を指定します。string を返します。 このメソッドは Zlib::Deflate.new, Zlib::ZStream#reset を呼び出した直後にのみ有効です。詳細は zlib.h を参照して下さい。

...指定します。string を返します。
このメソッドは Zlib::Deflate.new, Zlib::ZStream#reset
を呼び出した直後にのみ有効です。詳細は zlib.h を参照して下さい。

@param string 辞書に用いる文字列を指定します。詳しくは zlib.h を参照してく...
...uire 'zlib'

d
ef case1(str)
d
ez = Zlib::Deflate.new
comp_str = dez.deflate(str)
comp_str << dez.finish
comp_str.size
end

d
ef case2(str, dict)
d
ez = Zlib::Deflate.new
p dez.set_dictionary(dict)
comp_str = dez.deflate(str)
comp_str << dez.finish
comp_str.siz...
...nd

i
= 10
d
ict = 'hoge_fuga_ugougo'
sset = [ dict, 'taeagbamike', 'ugotagma', 'fugebogya' ]
g = [ 0, 1, 1, 1, 0, 0, 0, 3, 3, 3, 0, 0, 1, 1, 0, 0, 0, 1, 2, 2, 0, 0, 0, 2, 0, 1, 1, 0, 0, 0, 0, 0]
str = (1..i).collect{|m| t = rand(g.size); sset.at(g[t])}.join("")

printf "%d normal:%d, dic...

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

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

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

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

require 'zlib'

d
ef case2(str, dict)
d
ez = Zlib::Deflate.n...
...dez.set_dictionary(dict)
comp_str = dez.deflate(str)
comp_str << dez.finish
comp_str.size
i
nz = Zlib::Inflate.new
begin
i
nz.inflate(comp_str)
rescue Zlib::NeedDict
end
# 展開に用いる辞書が必要です。
i
nz.set_dictionary(dict)
p inz.inflate...
...(comp_str)
end
d
ict = 'hoge_fuga_ugougo'
sset = [ dict, 'taeagbamike', 'ugotagma', 'fugebogya' ]
g = [ 0, 0, 0, 1, 1, 1, 0, 0, 0, 3, 3, 3, 0, 0, 1, 1,
0, 0, 0, 1, 2, 2, 0, 0, 0, 2, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0]
str = g.collect{|m| sset.at(m)}.join("")

case2(str, dict)...