Node.js Buffer copy() copy one buffer to another

Description

Node.js Buffer copy() copy one buffer to another


//Buffer copy/* ww w  .jav  a 2  s  . co  m*/
var buffer1 = Buffer.from('buffer1 content');
var buffer2 = Buffer.alloc(16);
buffer1.copy(buffer2);
console.log(buffer2.toString());



PreviousNext

Related