📄 connectresponse.java
字号:
package com.gctech.cmpp.msg;
import com.gctech.util.Tools;
/**
* <p>Title: 连接应答。</p>
* <p>Description: 短信SP API</p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: GCTECH</p>
* @author 王红宝
* @version $Id: ConnectResponse.java,v 1.1 2004/05/21 07:50:10 wanghb Exp $
*/
public class ConnectResponse extends CmppMsg{
private byte status;
private byte[] authenISMG = new byte[16];
private byte version;
public ConnectResponse() {
super();
this.head.setCommandId(CommandID.CMPP_CONNECT_RESP);
this.head.setTotalLength(30);
this.version = 0x02;
}
public byte getStatus() {
return status;
}
public void setStatus(byte status) {
this.status = status;
}
public byte[] getAuthenISMG() {
return authenISMG;
}
public void setAuthenISMG(byte[] authenISMG) {
this.authenISMG = authenISMG;
}
public byte getVersion() {
return version;
}
public void setVersion(byte version) {
this.version = version;
}
protected void toByteArray(byte[] data) {
data[12] = this.status;
System.arraycopy(authenISMG, 0, data, 13, authenISMG.length);
data[29] = this.version;
}
public String toString() {
StringBuffer sb = new StringBuffer(super.toString());
sb.append(",Status:").append(this.status)
.append(",AuthenticatorISMG:")
.append(Tools.byteArrayToHexString(this.authenISMG))
.append(",Version:").append(this.getVersion());
return sb.toString();
}
public void fromByteArray(byte[] data) {
this.status = data[12];
System.arraycopy(data, 13, authenISMG, 0, 16);
this.version = data[29];
super.fromByteArray(data);
}
//add by liya
public ConnectResponse(CmppMsg cmppmsg) {
super(cmppmsg);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -