All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jtransc.io.classutils.kt Maven / Gradle / Ivy

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 - 2024 Weber Informatics LLC | Privacy Policy