What does it mean if binary data is “4 byte single format” and how do I read it in JavaScript?
问题 I have to read a binary file which is said to be encoded 4 byte single format and never having to work with binary data, I don't know what this means. I can do this reading a file with binary data in JavaScript: d = new FileReader(); d.onload = function (e) { var i, len; // grab a "chunk" response_buffer = e.target.result.slice(0, 1024); view = new DataView(response_buffer); for (i = 0, len = response_buffer.byteLength; i < len; i += 1) { // hmhm console.log(view.getUint8(i)); } } d