in = conn.getObjectInputStream();
in = conn.startObjectInputStream();
private Object invokeCommon(Remote obj, Method method, Object[] params, int opnum, long hash) throws Exception {	UnicastConnection conn;	try {		conn = manager.getConnection();	}	catch (IOException e1) {		throw new RemoteException("connection failed to host: " + manager.serverName, e1);	}	ObjectOutputStream out;	DataOutputStream dout;	try {		dout = conn.getDataOutputStream();		dout.writeByte(MESSAGE_CALL);		out = conn.getObjectOutputStream();				objid.write(out);		out.writeInt(opnum);		out.writeLong(hash);				// must handle primitive class and their wrapper classes		Class clss[] = method.getParameterTypes();	    for(int i = 0; i < clss.length; i++)	        ((RMIObjectOutputStream)out).writeValue(params[i], clss[i]);		out.flush();	}	catch (IOException e2) {		throw new RemoteException("call failed: ", e2);	}	int returncode;	Object returnval;	DataInputStream din;	ObjectInputStream in;	UID ack;	try {		din = conn.getDataInputStream();				if ((returncode = din.readUnsignedByte()) != MESSAGE_CALL_ACK) {		    conn.disconnect();			throw new RemoteException("Call not acked:" + returncode);		}		in = conn.getObjectInputStream();		returncode = in.readUnsignedByte();		ack = UID.read(in);		Class cls = method.getReturnType();        if(cls == Void.TYPE){            returnval = null;            in.readObject();        }else            returnval = ((RMIObjectInputStream)in).readValue(cls);	}	catch (IOException e3) {	    //for debug: e3.printStackTrace();		throw new RemoteException("call return failed: ", e3);	}    /* if DGCAck is necessary??    //According to RMI wire protocol, send a DGCAck     // to indicate receiving return value    dout.writeByte(MESSAGE_DGCACK);    ack.write(dout);    out.flush();    */    	manager.discardConnection(conn);	if (returncode != RETURN_ACK && returnval != null) {		throw (Exception)returnval;	}	return (returnval);}