Created
January 16, 2018 07:46
-
-
Save vamsitallapudi/81f76aeb0bd195c2d78f616f9a53efe0 to your computer and use it in GitHub Desktop.
Read a file in Kotlin using Extension Function
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
try { | |
val inputStream:InputStream = assets.open("news_data_file.json") | |
val inputString = inputStream.bufferedReader().use{it.readText()} | |
Log.d(TAG,inputString) | |
} catch (e:Exception){ | |
Log.d(TAG, e.toString()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment