创建Buffer:
let buf = Buffer.alloc(2) //指定长度
buf[0]=4;
buf[1]=5;
console.log(buf);
let buf1 = Buffer.from([1,2,3]) //指定数组
let buf3 = Buffer.alloc(5)
console.log(buf1);
let buf2 = Buffer.from("石旭")//指定字符串
console.log(buf2.toString());
buf.copy(buf3,0,0,3); //buffer复制
console.log(buf3);