I'm trying to read one line at a time from a .txt using FileInputStream.
FileInputStream in = null;
// Open an input stream
in = new FileInputStream("out.txt");
int c;
while ( (c = in.read() )!= -1 )
textArea2.append(new DataInputStream(in).readLine() );
in.close();
For this out.txt:
abc abc
lalala xyxy
It displays:
bc abcbc abcalala xyxy
How can I fix it ?