@@ -46,7 +46,7 @@ compressed_data = Zstd.compress(data, level: complession_level) # default compre
4646#### Compression with Dictionary
4747``` ruby
4848# dictionary is supposed to have been created using `zstd --train`
49- compressed_using_dict = Zstd .compress(" " , dict: IO .read(' dictionary_file' ))
49+ compressed_using_dict = Zstd .compress(" " , dict: File .read(' dictionary_file' ))
5050```
5151
5252#### Streaming Compression
@@ -70,7 +70,7 @@ res << stream.finish
7070
7171#### Streaming Compression with Dictionary
7272``` ruby
73- stream = Zstd ::StreamingCompress .new (dict: IO .read(' dictionary_file' ))
73+ stream = Zstd ::StreamingCompress .new (dict: File .read(' dictionary_file' ))
7474stream << " abc" << " def"
7575res = stream.flush
7676stream << " ghi"
@@ -79,7 +79,7 @@ res << stream.finish
7979
8080#### Streaming Compression with level and Dictionary
8181``` ruby
82- stream = Zstd ::StreamingCompress .new (level: 5 , dict: IO .read(' dictionary_file' ))
82+ stream = Zstd ::StreamingCompress .new (level: 5 , dict: File .read(' dictionary_file' ))
8383stream << " abc" << " def"
8484res = stream.flush
8585stream << " ghi"
@@ -97,7 +97,7 @@ data = Zstd.decompress(compressed_data)
9797#### Decompression with Dictionary
9898``` ruby
9999# dictionary is supposed to have been created using `zstd --train`
100- Zstd .decompress(compressed_using_dict, dict: IO .read(' dictionary_file' ))
100+ Zstd .decompress(compressed_using_dict, dict: File .read(' dictionary_file' ))
101101```
102102
103103#### Streaming Decompression
@@ -112,7 +112,7 @@ result << stream.decompress(cstr[10..-1])
112112#### Streaming Decompression with dictionary
113113``` ruby
114114cstr = " " # Compressed data
115- stream = Zstd ::StreamingDecompress .new (dict: IO .read(' dictionary_file' ))
115+ stream = Zstd ::StreamingDecompress .new (dict: File .read(' dictionary_file' ))
116116result = ' '
117117result << stream.decompress(cstr[0 , 10 ])
118118result << stream.decompress(cstr[10 ..- 1 ])
0 commit comments