public void run(){
  byte[] buf=new byte[256];
  int count;
  try {
    while ((count=in.read(buf)) != -1) {
      write(buf,0,count);
    }
    String lastInBuffer=bufOut.toString();
    bufOut.reset();
    if (lastInBuffer.length() > 0) {
      out.println(createAnnotation() + lastInBuffer);
      out.flush();
    }
  }
 catch (  IOException e) {
  }
}

public void run ( ) { byte [ ] buf = new byte [ 256 ] ; int count ; try { while ( ( count = in . read ( buf ) ) != - 1 ) { write ( buf , 0 , count ) ; } String lastInBuffer = bufOut . toString ( ) ; bufOut . reset ( ) ; if ( lastInBuffer . length ( ) > 0 ) { out . println ( createAnnotation ( ) + lastInBuffer ) ; out . flush ( ) ; } } catch ( IOException e ) { } }
create a thread to listen and read from input stream , in . buffer the data that is read until a marker which equals lineseparator is read . once such a string has been discovered ; write out an annotation string followed by the buffered data and a line separator .
