copy Zip Entry To Output Stream
private fun copyZipEntryToOutputStream(zipInputStream: ZipInputStream, outputStream: BufferedOutputStream, initialTotalUnpackedBytes: Long): Long
Streams the current zip entry to outputStream while enforcing both the per-entry and cumulative archive size limits. Size accounting is performed against actual decompressed bytes read from the stream rather than ZipEntry.getSize, which is attacker-controlled metadata and therefore untrustworthy for zip bomb defense. Throws IOException if maxUnpackedZipEntrySizeBytes or maxUnpackedZipSizeBytes would be exceeded; the caller converts this into a rejected archive.
Return
the updated cumulative byte total after this entry completes.
Parameters
zip Input Stream
the active zip stream positioned inside the current entry.
output Stream
the destination stream for the current entry.
initial Total Unpacked Bytes
cumulative bytes already written for previous entries.