📄 usertrig.java
字号:
/**
* <p>Title: Smgp协议解析</p>
* <p>Description: SMGW 向MSP 下发短消息的操作包</p>
* <p>Company: 福富软件 </p>
* @author chenxin
* @version 1.0 $Date 2007-07-05
*/
package ffcs.lbp.le.message;
import java.io.IOException;
import java.nio.ByteBuffer;
import ffcs.lbp.le.message.tlv.TLVTable;
public class UserTrig extends LeMessage {
private TLVTable Isdn=null;
public UserTrig() {
super(UserTrig);
}
public int getBodyLength() {
int len=0;
if(Isdn!=null){
len+= Isdn.getLength();
}
return len;
}
/**
* 读取协议包的包体
* @param buf ByteBuffer
* @throws MessageParseException
* @return boolean
*/
protected boolean readBody(ByteBuffer buf) throws
LeProtocolException{
int len = PackLength -HEADER_LENGTH;
if (len>0){
byte[] byteTemp=new byte[len];
buf.get(byteTemp);
Isdn = new TLVTable();
Isdn.readFrom(byteTemp,0,len);
}
return true;
}
/**
* 组成协议包的包体
* @param buf ByteBuffer
* @return boolean
*/
protected boolean writeBody(ByteBuffer buf){
if (Isdn!=null){
try {
Isdn.writeTo(buf);
} catch (IOException e) {
e.printStackTrace();
}
}
return true;
}
/**
* Convert this packet to a String. Not to be interpreted programmatically,
* it's just dead handy for debugging!
*/
public String toString() {
StringBuffer sb=new StringBuffer("UserTrig:");
sb.append(super.toString());
sb.append("Isdn");
sb.append("=");
if(Isdn!=null){
sb.append(Isdn.toString());
}
sb.append(" ");
return sb.toString();
}
public TLVTable getIsdn() {
return Isdn;
}
public void setIsdn(TLVTable isdn) {
Isdn = isdn;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -