1、问题背景
将不同的Buffer对象重新结合为一个新的Buffer对象
2、实现源码
> A=new Buffer('AA');
<Buffer 41 41>
> B=new Buffer('BB');
<Buffer 42 42>
> C=new Buffer('CC');
<Buffer 43 43>
> D=new Buffer('DD');
<Buffer 44 44>
> E=new Buffer('EE');
<Buffer 45 45>
> F=new Buffer('FF');
<Buffer 46 46>
> var buffer=Buffer.concat([A,B,C,D,E,F]);
undefined
> buffer;
<Buffer 41 41 42 42 43 43 44 44 45 45 46 46>
> buffer.toString();
'AABBCCDDEEFF'
> var buffer=Buffer.concat([A,B,C,D,E,F],14);
undefined
> buffer;
<Buffer 41 41 42 42 43 43 44 44 45 45 46 46 02 00>
> buffer.toString();
'AABBCCDDEEFFu0002u0000'
>