zstd-codec
zstd-codec copied to clipboard
How to compress / decompress in multiple steps?
I want to compress / decompress in multiple steps, instead of getting all the chunks and then do it at once.
- This is not what I want:
const chunks = [dataPart1, dataPart2, dataPart3, ...];
const compressed = streaming.compressChunks(chunks, size_hint);
- What i want is:
withBindingInstance(new binding.ZstdDecompressStreamBinding(), (stream) => {
stream.begin();
stream.transform(dataPart1, mycallback);
stream.transform(dataPart2, mycallback);
stream.transform(dataPart3, mycallback);
// ...
stream.end(mycallback);
});
- Question:
- How to get the
binding
object? - Can you expose a API for it?
- How to get the
Sorry for too late reply.
Currently, there is no way to get the binding directly due to the internal design. When I worked on this project, it was difficult for me to reuse the same binding object. Maybe it's possible to do it for now, I'll take a look in my free time.