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")
66
66
res << stream.finish
67
67
```
68
68
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
+
69
78
### Simple Decompression
70
79
71
80
``` ruby
@@ -87,6 +96,15 @@ result << stream.decompress(cstr[0, 10])
87
96
result << stream.decompress(cstr[10 ..- 1 ])
88
97
```
89
98
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
+
90
108
### Skippable frame
91
109
92
110
``` ruby
You can’t perform that action at this time.
0 commit comments