-
hello
while(m_bRun){
try{
sleep(5);
if(m_istInStream.available() > 0){
while(m_istInStream.available() > 0){
bytFromInputStream = new byte[m_istInStream.available()];
m_istInStream.read(bytFromInputStream);
strTextRead = new String(bytFromInputStream);
strTextToDisplay += strTextRead;
}
if(strTextToDisplay.endsWith("\n")){
m_frmParentFrame.displayText(strTextToDisplay);
strTextToDisplay = "";
}
}
}
catch(IOException e){
e.printStackTrace();
}
catch(InterruptedException e){
e.printStackTrace();
}
}
-
Re: hello
woops... what I meant to ask is does anyone know how to make it so that the while loop reads more than just one character at first? (it seems like it reads one character and then has to go through the while loop again to read the rest).
Any Ideas?