FileReader(); reader.onload = function() { var arraybuffer = reader.result; var dv = new DataView(arraybuffer); console.log(dv.getUint32(0)); } reader.readAsArrayBuffer(file);
header var txt = new TextDecoder(); while(offset < dv.byteLength) { var len = dv.getUint32(offset); var chunk_id = new Uint8Array(dv.buffer, offset+4, 4); var name = txt.decode(chunk_id); console.log("Chunk", name, len); offset += 4+4+4+len; }