1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package safeluck.drive.evaluation.platformMessage;
 
import com.anyun.exam.lib.MyLog;
import com.anyun.im_lib.util.ByteUtil;
 
public class StuInfoResp extends ServerProtocol {
 
    private int currPos = 0;
 
    private short result;
    private String ID;//身份证号码
    private String name;//姓名
    private String url;
 
    public StuInfoResp(byte[] rspBytes) {
        super(rspBytes);
    }
 
    @Override
    protected void parseMsgBody(byte[] msgbodyData) {
        result = ByteUtil.getShort(ByteUtil.subArray(msgbodyData,currPos,1));
        currPos +=1;
        MyLog.i(PlatFormConstant.TAG,"考试人员信息应答:"+result);
        if (result == PlatFormConstant.STU_INFO_SUCC){
            ID = ByteUtil.getString(ByteUtil.subArray(msgbodyData,currPos,18));
            currPos+=18;
            name = ByteUtil.getString(ByteUtil.subArray(msgbodyData,currPos,20));
            currPos+=20;
 
            url = ByteUtil.getString(ByteUtil.subArray(msgbodyData,currPos,msgBodyLength-currPos));
 
            MyLog.i(PlatFormConstant.TAG,"身份证:"+ID);
            MyLog.i(PlatFormConstant.TAG,"头像url:"+url);
            MyLog.i(PlatFormConstant.TAG,"姓名:"+name);
 
        }
 
    }
}