Node.js examples for Data Type:Uint8Array
Turns a buffer object into a string.
/**//from w ww. j av a2 s.com * turns a buffer object into a string. * * @param buffer * @returns {String} */ String.fromBuffer = function(buffer){ var string = ""; var ibuff = new Uint8Array(buffer); for(var i = 0; i < ibuff.length; i++){ string += String.fromCharCode(ibuff[i]); } return string; };