com.jtransc.io.classutils.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.IOException
fun Class.readBytes(): ByteArray {
val filePath = this.name.replace('.', '/') + ".class"
val stream = this.classLoader.getResourceAsStream(filePath) ?: throw IOException("Can't find class $filePath")
return stream.readBytes()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy