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.
var Buffer = require('buffer').Buffer';
var LZ4 = require('lz4');
var input = new Buffer(itemToCompress);
var output = new Buffer( LZ4.encodeBound(input.length) );
var compressedSize = LZ4.encodeBlock(input, output);
output = output.slice(0, compressedSize);
input buffer size is 66293, compressedSize is 8002, and output buffer is 66568.
However, slice doesn't seem to do anything to the buffer, and returns a buffer of the same size.
Am I missing something?
Thanks!
The text was updated successfully, but these errors were encountered:
I cannot see the behaviour that you describe: the output buffer gets correctly resized according to the compressed size.
Could you post a fully reproducible example?
Hey,
I'm trying to run a simple example:
var Buffer = require('buffer').Buffer';
var LZ4 = require('lz4');
var input = new Buffer(itemToCompress);
var output = new Buffer( LZ4.encodeBound(input.length) );
var compressedSize = LZ4.encodeBlock(input, output);
output = output.slice(0, compressedSize);
input buffer size is 66293, compressedSize is 8002, and output buffer is 66568.
However, slice doesn't seem to do anything to the buffer, and returns a buffer of the same size.
Am I missing something?
Thanks!
The text was updated successfully, but these errors were encountered: