(header: Header, content: Uint8Array, data: Uint8Array)
| 1120 | |
| 1121 | // Writes an entry whose content is known, with its sizes in the local header |
| 1122 | entry(header: Header, content: Uint8Array, data: Uint8Array): void { |
| 1123 | const size = header.type === "Directory" ? 0 : header.size |
| 1124 | if (size !== undefined && size !== content.length) throw sizeMismatch(header.path, content.length, size) |
| 1125 | const record = this.record(header, 0) |
| 1126 | record.crc = crc32(0, content) |
| 1127 | record.size = content.length |
| 1128 | record.compressedSize = data.length |
| 1129 | record.zip64 = record.size >= MAX32 || record.compressedSize >= MAX32 |
| 1130 | this.push(localHeader(record)) |
| 1131 | if (data.length > 0) this.push(data) |
| 1132 | this.records.push(record) |
| 1133 | } |
| 1134 | |
| 1135 | // Starts an entry whose sizes and CRC-32 follow its data |
| 1136 | begin(header: Header): void { |
no test coverage detected