Skip to content

Commit 4e6231b

Browse files
authored
Update README.md
1 parent 4ad9fc7 commit 4e6231b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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'))
7474
stream << "abc" << "def"
7575
res = stream.flush
7676
stream << "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'))
8383
stream << "abc" << "def"
8484
res = stream.flush
8585
stream << "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
114114
cstr = "" # Compressed data
115-
stream = Zstd::StreamingDecompress.new(dict: IO.read('dictionary_file'))
115+
stream = Zstd::StreamingDecompress.new(dict: File.read('dictionary_file'))
116116
result = ''
117117
result << stream.decompress(cstr[0, 10])
118118
result << stream.decompress(cstr[10..-1])

0 commit comments

Comments
 (0)