Created
June 10, 2023 09:59
-
-
Save crakaC/dde637ab8a3eabae2e2c0e303b97c268 to your computer and use it in GitHub Desktop.
resources内のファイルを読み込むやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun readResourceAsText(name: String): String { | |
return {}.javaClass.classLoader.getResource(name)!!.openStream().use { | |
it.readAllBytes().toString(Charsets.UTF_8) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment