@Override public Object readReply(Class expectedClass) throws Throwable {
  int tag=read();
  if (tag == 'R')   return readObject(expectedClass);
 else   if (tag == 'F') {
    HashMap map=(HashMap)readObject(HashMap.class);
    throw prepareFault(map);
  }
 else {
    StringBuilder sb=new StringBuilder();
    sb.append((char)tag);
    try {
      int ch;
      while ((ch=read()) >= 0) {
        sb.append((char)ch);
      }
    }
 catch (    IOException e) {
      log.log(Level.FINE,e.toString(),e);
    }
    throw error("expected hessian reply at " + codeName(tag) + "\n"+ sb);
  }
}

@ Override public Object readReply ( Class expectedClass ) throws Throwable { int tag = read ( ) ; if ( tag == 'R' ) return readObject ( expectedClass ) ; else if ( tag == 'F' ) { HashMap map = ( HashMap ) readObject ( HashMap . class ) ; throw prepareFault ( map ) ; } else { StringBuilder sb = new StringBuilder ( ) ; sb . append ( ( char ) tag ) ; try { int ch ; while ( ( ch = read ( ) ) >= 0 ) { sb . append ( ( char ) ch ) ; } } catch ( IOException e ) { log . log ( Level . FINE , e . toString ( ) , e ) ; } throw error ( "expected hessian reply at " + codeName ( tag ) + "\n" + sb ) ; } }
reads a reply as an object . if the reply has a fault , throws the exception .
