void readStream(InputStream is) throws Exception {
  String line;
  Date start=new Date();
  BufferedReader reader=new BufferedReader(new InputStreamReader(is));
  while ((line=reader.readLine()) != null && !mStop) {
    mResults.append(line);
    mResults.append(Tools.LineSep);
    Date end=new Date();
    if ((end.getTime() - start.getTime()) / 1000 > 10 || mResults.length() > 5000) {
      start=end;
      int last=mResults.lastIndexOf("\n");
      if (last != -1) {
        XmppMsg msg=new XmppMsg(_font);
        msg.append(mResults.substring(0,last + 1));
        mCmdBase.send(mShellId,msg);
        mResults.setLength(0);
      }
    }
  }
}

void readStream ( InputStream is ) throws Exception { String line ; Date start = new Date ( ) ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( is ) ) ; while ( ( line = reader . readLine ( ) ) != null && ! mStop ) { mResults . append ( line ) ; mResults . append ( Tools . LineSep ) ; Date end = new Date ( ) ; if ( ( end . getTime ( ) - start . getTime ( ) ) / 1000 > 10 || mResults . length ( ) > 5000 ) { start = end ; int last = mResults . lastIndexOf ( "\n" ) ; if ( last != - 1 ) { XmppMsg msg = new XmppMsg ( _font ) ; msg . append ( mResults . substring ( 0 , last + 1 ) ) ; mCmdBase . send ( mShellId , msg ) ; mResults . setLength ( 0 ) ; } } } }
reads the given inputstream and sends a xmppmsg every 5000 chars or every 10 seconds , whatever comes first . if we happen to encounter an inputstream that never stops , like from " tail - f " or " logcat " without the " - d " option , the method will never return . see executecommand on how we handle this .
