code: function ByteArrayToString(arr) {
      var ix, newarr;
      var len = arr.length;
      if (len == 0)
          return '';
      for (ix=0; ix<len; ix++) {
          if (arr[ix] < 0 || arr[ix] >= 0x100) 
              break;
      }
      if (ix == len) {
          return String.fromCharCode.apply(this, arr);
      }
      newarr = Array(len);
      for (ix=0; ix<len; ix++) {
          newarr[ix] = String.fromCharCode(arr[ix] & 0xFF);
      }
      return newarr.join('');
  }
docs: /* Convert an array of 8-bit values to a JS string, trimming if
  necessary.