Last active
August 25, 2017 09:52
-
-
Save AkshatAgrawal05/21f999e50b7d749e86bf8d4bc8aceb62 to your computer and use it in GitHub Desktop.
First Kotlin Project
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 getJsonFromAssets(): String? { | |
var json: String? = null | |
var inputStream: InputStream | |
inputStream = this.assets.open("reddit.json") | |
val size = inputStream.available() | |
val buffer = ByteArray(size) | |
inputStream.read(buffer) | |
inputStream.close() | |
json = String(buffer) | |
return json | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment