| | |
| | | System.arraycopy(msgIdBytes,0,desBytes,pos,msgIdBytes.length); |
| | | pos+=msgIdBytes.length; |
| | | |
| | | //消息体属性 |
| | | //消息体属性 默认为消息体长度 |
| | | msg_property = msgBodyLength(); |
| | | byte[] msg_pro_bytes = ByteUtil.shortGetBytes(msg_property); |
| | | System.arraycopy(msg_pro_bytes,0,desBytes,pos,msg_pro_bytes.length); |
| | | pos+=msg_pro_bytes.length; |
| | |
| | | return tranferbytes; |
| | | } |
| | | |
| | | protected abstract int msgBodyLength(); |
| | | protected abstract short msgBodyLength(); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | protected int msgBodyLength() { |
| | | protected short msgBodyLength() { |
| | | return BODY_LENGTH; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | protected int msgBodyLength() { |
| | | protected short msgBodyLength() { |
| | | return BODY_LENGTH; |
| | | } |
| | | |
| | |
| | | */ |
| | | public class RegisterMessage extends DriveExamProtocol { |
| | | |
| | | private static final int BODY_LENGTH = 3; |
| | | private static final int BODY_LENGTH = 4; |
| | | /** |
| | | * 构造函数 |
| | | * |
| | |
| | | } |
| | | |
| | | @Override |
| | | protected int msgBodyLength() { |
| | | protected short msgBodyLength() { |
| | | return BODY_LENGTH; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | protected int msgBodyLength() { |
| | | protected short msgBodyLength() { |
| | | return BODY_LENGTH; |
| | | } |
| | | |