Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to compress / decompress in multiple steps? #300

Open
lonnywong opened this issue Apr 8, 2023 · 1 comment
Open

How to compress / decompress in multiple steps? #300

lonnywong opened this issue Apr 8, 2023 · 1 comment

Comments

@lonnywong
Copy link

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?
@yoshihitoh
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants