docs: public void run() {
          int length;
          char cs[] = new char[256];
          int ioErrorCount = 0;
          Reader reader = pair.getReader();
  
          logger.trace("Starting primary loop");
          while ( !stopRequested && !foundEOF && ioErrorCount < 4) {
              try {
                  logger.trace("Checking ready");
                  boolean ready = false;
                  try {
                      ready = reader.ready(); // will not block
                      if( reader.markSupported() ) logger.trace("Mark Supported");
                  } catch(Exception ioe) {
                      // The Pipe most likely closed on us.
                      logger.debug("Exception in PollingConsumer: " + ioe);
                      foundEOF = true;
                      break;
                  }
  
                  //if( !ready ) { ready = true; log.fine("Faking ready"); }
  
                  if ( ready ) {
                      logger.trace("Is Ready");
  
  
                      // don't modify the buffer while processing is happening
                      // written as while loop to prevent spurious interrupts
                      synchronized(this) {
                          while( callerProcessing.booleanValue() ) {
                              logger.trace("Waiting for caller to finish");
                              try {
                                  wait();
                              } catch(InterruptedException ie) {
                                  logger.trace("Woken up early");
                                  continue;
                              }
                          }
  
                          logger.trace("About to wait for buffer lock");
                          synchronized(buffer) {
                              length = reader.read(cs);
  
                              if( length == -1 ) { //EOF
                                  logger.trace("Found the EOF");
                                  logger.trace("Current buffer: " + buffer.toString() );
                                  foundEOF = true;
                                  dirtyBuffer = true;
                                  break;
                              }
  
                              String print = new String(cs, 0, length);
                              print = print.replaceAll("\n", "\\\\n");
                              print = print.replaceAll("\r", "\\\\r");
                              logger.trace("Appending >>>" + print + "<<<");
                              buffer.append( cs, 0, length ); // thread safe
  
                              logger.trace("Current Buffer: " + buffer.toString() );
                              dirtyBuffer = true;
  
                              /**
                               * TODO Trim down buffer.  This current method won't work if a resume comes in, since it's offset
                               * will be invalid once this delete method runs
                               *
                               * // since we only added one char, we should only have to remove one
                               * if( buffer.length() > BUFFERMAX )
                               * buffer.delete(0, BUFFERMAX - buffer.length() );
                               */
  
                              logger.trace("Waking up who ever if listening");
                              buffer.notify(); // seeing that we read something, wait people up
  
                              // We explicitly call this after appending to the
                              // buffer, just in case one of the BufferChangeLoggers
                              // accidentally modifies the character buffer.
                              notifyBufferChange(cs, length);
                          }
                      }
  
                  } else {
                      logger.trace("Not Ready, sleeping");
                      try { Thread.sleep(500); } catch(InterruptedException ie) { }
                      logger.trace("Done sleeping");
                      //continue;
                  }
              }catch(IOException ioe) {
                  logger.warn("Exception in loop body: " + ioe);
                  ioErrorCount++;
                  //continue;
              }
          } // end while loop
  
  
          synchronized(buffer) {
              buffer.notify();
          }
          if( stopRequested ) {
              logger.debug("Stop Requested");
              pair.close();
          }
          if ( foundEOF )
              logger.debug("Found EOF to stop while loop");
          if( ioErrorCount >= 4 )
              logger.debug("ioErrorCount at " + ioErrorCount );
          logger.trace("Leaving primary loop");
      }