lizhanwei
2020-02-17 ee16db5e1cbc1c27bdbc1984567b5e61a3d005dd
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package safeluck.drive.evaluation.platformMessage;
 
import com.anyun.im_lib.util.ByteUtil;
 
public class ClientCommonRsp extends DriveExamProtocol {
    private static final int BODY_LENGTH = 5;
 
    private short result;//结果
    private short msgId;//对应的服务器端消息id
    private short msg_serial;//服务器消息给的流水号
 
    private int curPos = 0;
 
    /**
     * 构造函数
     *
     *
     */
    public ClientCommonRsp() {
        super((short) 0x0001);
    }
 
    @Override
    protected byte[] createMessageBody() {
        byte[] messageBody = new byte[BODY_LENGTH];
        byte[] msg_serialBytes= ByteUtil.shortGetBytes(msg_serial);
        byte[] msgidBytes = ByteUtil.shortGetBytes(msgId);
        System.arraycopy(msg_serialBytes,0,messageBody,curPos,2);
        curPos += 2;
        System.arraycopy(msgidBytes,0,messageBody,curPos,2);
        curPos += 2;
        System.arraycopy(ByteUtil.shortGetByte(result),0,messageBody,curPos,1);
        return messageBody;
    }
 
    @Override
    protected short msgBodyLength() {
        return BODY_LENGTH;
    }
 
    public short getResult() {
        return result;
    }
 
    public void setResult(short result) {
        this.result = result;
    }
 
    public short getMsgId() {
        return msgId;
    }
 
    public void setMsgId(short msgId) {
        this.msgId = msgId;
    }
 
    public short getMsg_serial() {
        return msg_serial;
    }
 
    public void setMsg_serial(short msg_serial) {
        this.msg_serial = msg_serial;
    }
}