protected void loadChars(AbstractMRReply msg,DataInputStream istream) throws IOException {
  int i;
  for (i=0; i < msg.maxSize(); i++) {
    byte char1=readByteProtected(istream);
    if (flushReceiveChars) {
      log.warn("timeout flushes receive buffer: {}",msg.toString());
      msg.flush();
      i=0;
      flushReceiveChars=false;
    }
    if (canReceive()) {
      msg.setElement(i,char1);
      if (endOfMessage(msg)) {
        break;
      }
    }
 else {
      i--;
      log.error("unsolicited character received: {}",Integer.toHexString(char1));
    }
  }
}

protected void loadChars ( AbstractMRReply msg , DataInputStream istream ) throws IOException { int i ; for ( i = 0 ; i < msg . maxSize ( ) ; i ++ ) { byte char1 = readByteProtected ( istream ) ; if ( flushReceiveChars ) { log . warn ( "timeout flushes receive buffer: {}" , msg . toString ( ) ) ; msg . flush ( ) ; i = 0 ; flushReceiveChars = false ; } if ( canReceive ( ) ) { msg . setElement ( i , char1 ) ; if ( endOfMessage ( msg ) ) { break ; } } else { i -- ; log . error ( "unsolicited character received: {}" , Integer . toHexString ( char1 ) ) ; } } }
get characters from the input source , and file a message . < p > returns only when the message is complete . < p > only used in the receive thread . < p > handles timeouts on read by ignoring zero - length reads .
