ex.printStackTrace(); LOG.fine(String.format("Could not process variable %d of the data frame.", k));
REXP parseEvalResponse(RPacket rp) throws RserveException { int rxo=0; byte[] pc=rp.getCont(); if (rsrvVersion>100) { /* since 0101 eval responds correctly by using DT_SEXP type/len header which is 4 bytes long */ rxo=4; /* we should check parameter type (should be DT_SEXP) and fail if it's not */ if (pc[0]!=RTalk.DT_SEXP && pc[0]!=(RTalk.DT_SEXP|RTalk.DT_LARGE)) throw new RserveException(this,"Error while processing eval output: SEXP (type "+RTalk.DT_SEXP+") expected but found result type "+pc[0]+"."); if (pc[0]==(RTalk.DT_SEXP|RTalk.DT_LARGE)) rxo=8; // large data need skip of 8 bytes /* warning: we are not checking or using the length - we assume that only the one SEXP is returned. This is true for the current CMD_eval implementation, but may not be in the future. */ } if (pc.length>rxo) { try { REXPFactory rx=new REXPFactory(); rx.parseREXP(pc, rxo); return rx.getREXP(); } catch (REXPMismatchException me) { me.printStackTrace(); throw new RserveException(this, "Error when parsing response: "+me.getMessage()); } } return null; }
REXP parseEvalResponse(RPacket rp) throws RserveException { int rxo=0; byte[] pc=rp.getCont(); if (rsrvVersion>100) { /* since 0101 eval responds correctly by using DT_SEXP type/len header which is 4 bytes long */ rxo=4; /* we should check parameter type (should be DT_SEXP) and fail if it's not */ if (pc[0]!=RTalk.DT_SEXP && pc[0]!=(RTalk.DT_SEXP|RTalk.DT_LARGE)) throw new RserveException(this,"Error while processing eval output: SEXP (type "+RTalk.DT_SEXP+") expected but found result type "+pc[0]+"."); if (pc[0]==(RTalk.DT_SEXP|RTalk.DT_LARGE)) rxo=8; // large data need skip of 8 bytes /* warning: we are not checking or using the length - we assume that only the one SEXP is returned. This is true for the current CMD_eval implementation, but may not be in the future. */ } if (pc.length>rxo) { try { REXPFactory rx=new REXPFactory(); rx.parseREXP(pc, rxo); return rx.getREXP(); } catch (REXPMismatchException me) { me.printStackTrace(); throw new RserveException(this, "Error when parsing response: " + me.getMessage(), me); } } return null; }