You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
Hello,
I just started using the library and can almost get it to work correctly. I have LZ4 blocks coming in as Base64 strings and I decode them with: data = new Buffer(input,'base64'); var output = new Buffer(data.length*10); var size = lz4.decodeBlock(data,output);
The returned 'size' is < 0 so there seems to be an error, but when I dump the results of 'output' to the console part of the original data is there properly decompressed. So it seems to be doing something right. Increasing the size of the buffer gets closer to showing the desired output, but is missing the last few characters. ('size' still < 0)
If I change the code to: var output = new Buffer(data.length*100); var size = lz4.decodeBlock(data,output,0,data.length*100);
I see the entire decompressed data, but also some extra garbage characters at the end of the output. 'size' still < 0. I tried multiple variations of the different properties and tried running the same data through a different .NET LZ4 library and it works as expected. I also tried using the 'size' in different ways with slice, but no luck in trimming the trailing characters.
Any ideas on what might be happening here? Feels like I'm missing something simple.
Thanks in advance for any help.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello,
I just started using the library and can almost get it to work correctly. I have LZ4 blocks coming in as Base64 strings and I decode them with:
data = new Buffer(input,'base64');
var output = new Buffer(data.length*10);
var size = lz4.decodeBlock(data,output);
The returned 'size' is < 0 so there seems to be an error, but when I dump the results of 'output' to the console part of the original data is there properly decompressed. So it seems to be doing something right. Increasing the size of the buffer gets closer to showing the desired output, but is missing the last few characters. ('size' still < 0)
If I change the code to:
var output = new Buffer(data.length*100);
var size = lz4.decodeBlock(data,output,0,data.length*100);
I see the entire decompressed data, but also some extra garbage characters at the end of the output. 'size' still < 0. I tried multiple variations of the different properties and tried running the same data through a different .NET LZ4 library and it works as expected. I also tried using the 'size' in different ways with slice, but no luck in trimming the trailing characters.
Any ideas on what might be happening here? Feels like I'm missing something simple.
Thanks in advance for any help.
The text was updated successfully, but these errors were encountered: