I try to read a file and display the data on the TextField.
But it does not read the next line.
For example, for two lines,
How are you? Long time no see.
I remember you.
The program does not show the sentence "I remember you"
How should i do that?
try {
fileconnection=(FileConnection)Connector.open(path+filedir);
InputStream is=fileconnection.openInputStream();
ByteArrayOutputStream baos=new ByteArrayOutputStream();
byte[]buffer=new byte[1024];
int bytesRead=0;
while((bytesRead=is.read(buffer))!=-1)
{
baos.write(buffer,0,bytesRead);
TFileReadWriteMIDlet.tfilereadwritemidlet.mainform.txtfield.setString(baos.toString());
}
//TFileReadWriteMIDlet.tfilereadwritemidlet.mainform.txtfield.setString(baos.toString());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}