Create ArrayBuffer from Array (holding integers) and back again
问题 It seems so simple, but I cannot find out how to convert an Array filled with integers to an ArrayBuffer and back again to an Array . There are lots of examples where strings are converted to an ArrayBuffer like for example here . Using these examples I created this: /** * Convert string to array buffer. * * @param {Array.<int>} array * @returns {ArrayBuffer} */ self.arrayToArrayBuffer = function( array ) { var length = array.length; var buffer = new ArrayBuffer( length * 2 ); var view = new