View Single Post
  #3 (permalink)  
Old 07-19-2007, 08:32 AM
adoorsarath adoorsarath is offline
Member
 
Join Date: Jul 2007
Posts: 2
adoorsarath is on a distinguished road
Code is given below
Code:
class ModemReader extends Thread { InputStream in=SimpleSMSReader.inputStream; int c; public void run() {try {while(true) { if(SimpleSMSReader.readMessage==true) { c=in.read(); while (c != -1) { queue.put((byte) c); c = in.read(); } SimpleSMSReader.readMessage=false; //Here i have to write some code to parse the message. // ie.. only after reading the whole data available. //but in this case it is not exiting from the loop instead // it waits for another data availability.and reads when // data available. } } }catch(Exception e) { System.out.println(e.toString()); } } }
description:

When some data is available in the inputStream,the static variable readMessage in the class SimpleSMSReader is set to True.

Last edited by JavaBean : 07-19-2007 at 09:08 AM.
Reply With Quote