1

我的 node.js 脚本中有以下行会生成致命错误:

var compressedOutput = lz4.encode(new Buffer(logdata,"utf8"));

变量“logdata”包含我使用 http 请求参数创建的字符串。这是 lz4 的问题还是我创建缓冲区的方式?我该如何解决?错误信息如下:

    buffer.js:705
    throw TypeError('value is out of bounds');
          ^
TypeError: value is out of bounds
    at TypeError (<anonymous>)
    at checkInt (buffer.js:705:11)
    at Buffer.writeInt32LE (buffer.js:782:5)
    at Encoder._flush (/var/www/node_modules/lz4/lib/encoder_stream.js:210:7)
    at Encoder.<anonymous> (_stream_transform.js:130:12)
    at Encoder.g (events.js:180:16)
    at Encoder.emit (events.js:92:17)
    at finishMaybe (_stream_writable.js:359:12)
    at endWritable (_stream_writable.js:366:3)
    at Encoder.Writable.end (_stream_writable.js:344:5)
worker 3884 died

谢谢,非常感谢!

4

0 回答 0