資源簡介
cmpp2 java實(shí)現(xiàn)及網(wǎng)關(guān)模擬器,親測可用,使用教程:http://blog.csdn.net/wu_jia123/article/details/50039953
代碼片段和文件信息
package?common.msg.domain;
import?java.io.ByteArrayInputStream;
import?java.io.DataInputStream;
import?java.io.IOException;
import?org.apache.log4j.Logger;
/**
?*?
?*?鏈路檢查消息結(jié)構(gòu)定義
?*?@author?張科偉
?*?2011-08-22?17:30
?*/
public?class?MsgActiveTestResp?extends?MsgHead?{
private?static?Logger?logger=Logger.getLogger(MsgActiveTestResp.class);
private?byte?reserved;//
public?MsgActiveTestResp(byte[]?data){
if(data.length==8+1){
ByteArrayInputStream?bins=new?ByteArrayInputStream(data);
DataInputStream?dins=new?DataInputStream(bins);
try?{
this.setTotalLength(data.length+4);
this.setCommandId(dins.readInt());
this.setSequenceId(dins.readInt());
this.reserved=dins.readByte();
dins.close();
bins.close();
}?catch?(IOException?e){}
}else{
logger.info(“鏈路檢查解析數(shù)據(jù)包出錯(cuò),包長度不一致。長度為:“+data.length);
}
}
public?byte?getReserved()?{
return?reserved;
}
public?void?setReserved(byte?reserved)?{
this.reserved?=?reserved;
}
}
- 上一篇:dbcp Jar包
- 下一篇:android sqlite操作 demo
評論
共有 條評論