File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,20 @@ result << stream.decompress(cstr[10..-1])
169
169
170
170
DDict can also be specified to ` dict: ` .
171
171
172
+ #### Streaming Decompression with Position Tracking
173
+
174
+ If you need to know how much of the input data was consumed during decompression, you can use the ` decompress_with_pos ` method:
175
+
176
+ ``` ruby
177
+ cstr = " " # Compressed data
178
+ stream = Zstd ::StreamingDecompress .new
179
+ result, consumed_bytes = stream.decompress_with_pos(cstr[0 , 10 ])
180
+ # result contains the decompressed data
181
+ # consumed_bytes contains the number of bytes from input that were processed
182
+ ```
183
+
184
+ This is particularly useful when processing streaming data where you need to track the exact position in the input stream.
185
+
172
186
### Skippable frame
173
187
174
188
``` ruby
You can’t perform that action at this time.
0 commit comments