phsdeliverrep.java

来自「JAVA实现的短信网关程序」· Java 代码 · 共 68 行

JAVA
68
字号
package sms.PHS;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class PHSDeliverRep extends PHSResponse{   private static final int COMMAND_ID = 0x80000003;   private static final int lenMessageBody = 14;   private static final int lenMsgId = 10;   private static final int lenResult = 4;   private String msgId;   private int result;    public PHSDeliverRep(String Msg_Id, int Result) throws PHSException{        super(0x80000003);        result = 0;        setMsgId(Msg_Id);        setResult(Result);    }    public PHSDeliverRep(int SequenceId, String Msg_Id, int Result)        throws PHSException{        super(0x80000003, SequenceId);        result = 0;        setMsgId(Msg_Id);        setResult(Result);    }    public void encodePacket(PHSIO cmppio)        throws PHSException{        insertInteger(result);        insertString(msgId);        if(getLength() != 14){            throw new PHSException("encodePacket : invalid packet length !");        }        else{            super.encodePacket(cmppio);            return;        }    }    public String getMsgId(){        return msgId;    }    public int getResult(){        return result;    }    public void setMsgId(String msgId){        this.msgId = msgId;    }    public void setResult(int result){        this.result = result;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?