|
|
@ -6,17 +6,17 @@ |
|
|
|
*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* Concatenate `this` Buffer with `buf`. |
|
|
|
* Concatenate `this` Buffer with `other`. |
|
|
|
* |
|
|
|
* @param {Buffer} buf |
|
|
|
* @param {Buffer} other |
|
|
|
* @return {Buffer} |
|
|
|
* @api public |
|
|
|
*/ |
|
|
|
|
|
|
|
Buffer.prototype.concat = function(buf) { |
|
|
|
Buffer.prototype.concat = function(other) { |
|
|
|
var len = this.length |
|
|
|
, tmp = new Buffer(len + buf.length); |
|
|
|
this.copy(tmp, 0, 0); |
|
|
|
buf.copy(tmp, len, 0); |
|
|
|
return tmp; |
|
|
|
, buf = new Buffer(len + other.length); |
|
|
|
this.copy(buf, 0, 0); |
|
|
|
other.copy(buf, len, 0); |
|
|
|
return buf; |
|
|
|
}; |