arrayBufferToString = function(buffer) {
  var array = new Uint8Array(buffer);
  var str = '';
  for (var i = 0; i < array.length; ++i) {
    str += String.fromCharCode(array[i]);
  }
  return str;
}
Convert from an ArrayBuffer to a string.
@param {ArrayBuffer} buffer The array buffer to convert.
@return {string} The textual representation of the array.