Created
May 18, 2015 07:55
-
-
Save hoseinquest/507af5f43368e499eec7 to your computer and use it in GitHub Desktop.
Android Read Text File From Assets
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
InputStream input; | |
try { | |
input = getAssets().open(fileName); | |
int size = input.available(); | |
byte[] buffer = new byte[size]; | |
input.read(buffer); | |
input.close(); | |
String text = new String(buffer); | |
} | |
catch (IOException e) { | |
e.printStackTrace(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment