📄 submitresponse.java
字号:
package com.gctech.cmpp.msg;
import java.io.*;
import org.apache.log4j.Logger;
/**
* <p>Title: 短信 API</p>
* <p>Description: 短信SP API</p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: GCTECH</p>
* @author 王红宝
* @version $Id: SubmitResponse.java,v 1.2 2004/07/16 08:33:16 wanghb Exp $
*/
public class SubmitResponse extends CmppMsg{
private static final int msg_length=21;
private byte[] msgId;
private byte status;
public SubmitResponse() {
super();
this.head.setCommandId(CommandID.CMPP_SUBMIT_RESP);
}
public byte[] getMsgId() {
return msgId;
}
public void setMsgId(byte[] msgId) {
this.msgId = msgId;
}
public byte getStatus() {
return status;
}
public void setStatus(byte status) {
this.status = status;
}
public void toByteArray(byte[] data) {
try {
//CmppMsg.BytesCopy(CmppMsg.IntToBytes4(msg_length),data,0,3,0);
//CmppMsg.BytesCopy(
// CmppMsg.IntToBytes4(CommandID.CMPP_SUBMIT_RESP),data,0,3,4);
//CmppMsg.BytesCopy(CmppMsg.IntToBytes4(head.getSequenceId()),data,0,3,8);
CmppMsg.BytesCopy(msgId,data,0,7,12);
data[20]=status;
}
catch (Throwable ex) {
logger.error("", ex);
}
/**@todo Implement this com.gctech.cmpp.msg.CmppMsg abstract method*/
}
public void fromByteArray(byte[] data, int offset) {
super.fromByteArray(data, offset);
this.msgId = new byte[8];
System.arraycopy(data, 8, msgId, 0, 8);
this.status = data[9];
}
public String toString() {
return "submit reponse:"+super.toString();
}
public SubmitResponse(CmppMsg cmppmsg) {
super(cmppmsg);
this.head.setCommandId(CommandID.CMPP_SUBMIT_RESP);
}
public SubmitResponse(byte[] msgid) {
this();
this.msgId=msgid;
}
/**
public SubmitResponse(MsgHead msghead) {
super(msghead,body_length,CommandID.CMPP_SUBMIT_RESP);
}
*/
/**
public int write(OutputStream outputstream){
try
{
byte abyte0[] = new byte[TotalLength];
BytesCopy(head.Head, abyte0, 0, 11, 0);
BytesCopy(bodybytes, abyte0, 0, TotalLength - 11 - 1, 12);
outputstream.write(abyte0);
return 0;
}
catch(Exception exception)
{
System.out.println(exception.toString());
}
return -1;
}
*/
Logger logger = Logger.getLogger(SubmitResponse.class);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -