(archive, position)
| 75 | }); |
| 76 | |
| 77 | function readAtom(archive, position) { |
| 78 | let bytes = new Uint8Array(archive.read(position, 8)); |
| 79 | let byteLength = (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3]; |
| 80 | if ((byteLength < 8) || (byteLength > 0x100000)) |
| 81 | throw new Error("invalid atom size"); |
| 82 | let name = String.fromCharCode(bytes[4], bytes[5], bytes[6], bytes[7]); |
| 83 | return {name, byteLength}; |
| 84 | } |
| 85 | |
| 86 | function readString(archive, position) { |
| 87 | let result = ""; |