标签:返回 api 长度 数组 red console ons container head
Buffer.concat(list[, totalLength])
var buf1=Buffer.alloc(10,0);
var buf2=Buffer.alloc(11,0);
var buf3=Buffer.alloc(5,0);
var len=buf1.length+buf2.length+buf3.length;
console.log(`len:${len}`);//26
const bufA=Buffer.concat([buf1,buf2,buf3],len);
console.log(bufA);
//<Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00>
console.log(bufA.length);
//26
标签:返回 api 长度 数组 red console ons container head
原文地址:https://www.cnblogs.com/Syinho/p/12600462.html