Convert Int8Array to byte[] javascript
问题 I am trying to pass an Int8Array, which is created from an array buffer to a java method via DWR, which accepts it as a byte[] parameter. Javascript : uploadFiles: function(eve) { var fileContent = null; for(var i = 0; i < this.filesToBeUploaded.length; i++){ var reader = new FileReader(); reader.onload = (function(fileToBeUploaded) { return function(e) { file = e.target.result; var view = new Int8Array(file); // fileContent object contains the content of the read file }; })(this