You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
366 B
18 lines
366 B
4 years ago
|
var Buffers = require('buffers');
|
||
|
var bufs = Buffers([
|
||
|
new Buffer([1,2,3]),
|
||
|
new Buffer([4,5,6,7]),
|
||
|
new Buffer([8,9,10]),
|
||
|
]);
|
||
|
|
||
|
var removed = bufs.splice(2, 4, new Buffer('ab'), new Buffer('cd'));
|
||
|
console.dir({
|
||
|
removed : removed.slice(),
|
||
|
bufs : bufs.slice(),
|
||
|
});
|
||
|
|
||
|
/* Output:
|
||
|
{ removed: <Buffer 03 04 05 06>,
|
||
|
bufs: <Buffer 01 02 07 08 09 0a> }
|
||
|
*/
|