I wrote InputStream to read text line by line from Android Asset Folder. If I use Buffered Reader, I can use readLine(), so I want to change InputStream to Buffered Reader What should I do?
InputStream is;
is = myContext.getAssets().open ("file.txt");
BufferedReader br = new BufferedReader (is);
Here, on the third line
Multiple markers at this line
The constructor BufferedReader (InputStream) is undefinded.
I get this error.
As in C
StreamReader file;
file = File.OpenText ("file.txt");
line = file.ReadLine();
line = file.ReadLine();
...
I want to do it this way, but did I do something wrong? What should I do?
android java inputstream readline bufferedreader
BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
BufferedReader cannot convert InputStream directly. So you have to do it like above.
© 2024 OneMinuteCode. All rights reserved.