Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Buffer.prototype.append = function(buf) {
- var newBuf = new Buffer(this.length + buf.length);
- this.copy(newBuf, 0, 0);
- if (Buffer.isBuffer(buf))
- buf.copy(newBuf, this.length, 0);
- else if (Array.isArray(buf)) {
- for (var i=this.length, len=buf.length; i<len; i++)
- newBuf[i] = buf[i];
- }
- return newBuf;
- };
Add Comment
Please, Sign In to add comment