Skip to content

Instantly share code, notes, and snippets.

@crakaC
Created June 10, 2023 09:59
Show Gist options
  • Save crakaC/dde637ab8a3eabae2e2c0e303b97c268 to your computer and use it in GitHub Desktop.
Save crakaC/dde637ab8a3eabae2e2c0e303b97c268 to your computer and use it in GitHub Desktop.
resources内のファイルを読み込むやつ
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