com.jtransc.io.zip.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jtransc-utils Show documentation
Show all versions of jtransc-utils Show documentation
JVM AOT compiler currently generating JavaScript, C++, Haxe, with initial focus on Kotlin and games.
package com.jtransc.io
import java.io.ByteArrayOutputStream
import java.util.zip.ZipEntry
import java.util.zip.ZipOutputStream
fun createZipFile(files: Map): ByteArray {
val baos = ByteArrayOutputStream()
val out = ZipOutputStream(baos);
for ((name, content) in files) {
val entry = ZipEntry(name)
out.putNextEntry(entry);
out.write(content)
out.closeEntry()
}
out.close()
return baos.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy