Skip to content

Instantly share code, notes, and snippets.

@liangfeidotme
Created January 24, 2019 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liangfeidotme/8d3bfa5dcd7ddbff1a149aead19cd49a to your computer and use it in GitHub Desktop.
Save liangfeidotme/8d3bfa5dcd7ddbff1a149aead19cd49a to your computer and use it in GitHub Desktop.
Read the asset file into a String.
object FileUtils {
fun readAssetFileToString(context: Context, assetFileName: String)
= context.assets.open(assetFileName).bufferedReader().use { it.readText() }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment