Hi,
I suppose this is a bug
var b = new Buffer(1)
var c = new Buffer(0)
var a = Buffer.concat(b,c)
buffer.js:223
throw new TypeError('list argument must be an Array of Buffers.');
TypeError: list argument must be an Array of Buffers.
at Function.Buffer.concat (buffer.js:223:11)
seems the concat function does not accept zero-size Buffer
node v. 4.3.1
sorry, my mistake
var b = new Buffer(1)
var c = new Buffer(0)
var a = Buffer.concat([b,c])
Hello,
Buffer.concat expects an Array of Buffer objects as its first argument. In you test case you are passing two separate arguments to the function.
The correct code would be:
var b = new Buffer(1)
var c = new Buffer(0)
var a = Buffer.concat([b,c])
Most helpful comment
Hello,
Buffer.concatexpects an Array of Buffer objects as its first argument. In you test case you are passing two separate arguments to the function.The correct code would be: