File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,15 @@ res << stream.compress("def")
6666res << stream.finish
6767```
6868
69+ ### Streaming Compression using Dictionary
70+ ``` ruby
71+ stream = Zstd ::StreamingCompress .new (dict: IO .read(' dictionary_file' ))
72+ stream << " abc" << " def"
73+ res = stream.flush
74+ stream << " ghi"
75+ res << stream.finish
76+ ```
77+
6978### Simple Decompression
7079
7180``` ruby
@@ -87,6 +96,15 @@ result << stream.decompress(cstr[0, 10])
8796result << stream.decompress(cstr[10 ..- 1 ])
8897```
8998
99+ ### Streaming Decompression using dictionary
100+ ``` ruby
101+ cstr = " " # Compressed data
102+ stream = Zstd ::StreamingDecompress .new (dict: IO .read(' dictionary_file' ))
103+ result = ' '
104+ result << stream.decompress(cstr[0 , 10 ])
105+ result << stream.decompress(cstr[10 ..- 1 ])
106+ ```
107+
90108### Skippable frame
91109
92110``` ruby
You can’t perform that action at this time.
0 commit comments