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

Output buffer re-use #42

Open
samcday opened this issue Mar 8, 2019 · 3 comments
Open

Output buffer re-use #42

samcday opened this issue Mar 8, 2019 · 3 comments

Comments

@samcday
Copy link

samcday commented Mar 8, 2019

Thanks for authoring this lib!

Currently I have to drop down to the unsafe lz4-sys bindings because the higher level stuff doesn't quite fit my use-case. My issue is that all the high level APIs are allocating the output buffer themselves. It would be ideal if the lz4::block::* methods had variants that allowed you to supply an output &mut [u8], and the lz4::Decoder / lz4::Encoder structs allowed you to supply an output Vec<u8>. What do you think? If you have some ideas on how you want the API to look I'm happy to whip up a PR.

@samcday
Copy link
Author

samcday commented Mar 8, 2019

e.g flate2 has this functionality

@jheyens
Copy link
Collaborator

jheyens commented Mar 9, 2019

Hi,
I actually intend to adjust the API to closely match flate2 for a 2.0 release. This is currently not very high on my priority list, though, so feel free to start.

@samcday
Copy link
Author

samcday commented Mar 26, 2019

I ended up going with the snap crate instead, since I wanted something that works for WebAssembly target. I'll leave this issue open in case someone else feels like tackling it though!

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