]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - apps/tidep0084.git/blob - example/iot-gateway/node_modules/depd/lib/compat/buffer-concat.js
Updated to use the latest TI 15.4-Stack v2.1.0 from the SimpleLink CC13x0 SDK v1.30.
[apps/tidep0084.git] / example / iot-gateway / node_modules / depd / lib / compat / buffer-concat.js
1 /*!
2  * depd
3  * Copyright(c) 2014 Douglas Christopher Wilson
4  * MIT Licensed
5  */
7 'use strict'
9 /**
10  * Module exports.
11  */
13 module.exports = bufferConcat
15 /**
16  * Concatenate an array of Buffers.
17  */
19 function bufferConcat(bufs) {
20   var length = 0
22   for (var i = 0, len = bufs.length; i < len; i++) {
23     length += bufs[i].length
24   }
26   var buf = new Buffer(length)
27   var pos = 0
29   for (var i = 0, len = bufs.length; i < len; i++) {
30     bufs[i].copy(buf, pos)
31     pos += bufs[i].length
32   }
34   return buf
35 }