fun resourceBytes()

in kotlin/app-homepage-react/src/main/kotlin/org/homepage/Utils.kt [5:10]


fun resourceBytes(resourcePath: String): ByteArray {
    val inputStream =
        Space::class.java.classLoader.getResourceAsStream(resourcePath)
            ?: error("Could not read resource $resourcePath")
    return inputStream.use { it.readBytes() }
}