registered_delivery.java

来自「java支持的短信平台」· Java 代码 · 共 66 行

JAVA
66
字号
package com.khan.sms.cmpp3;


import com.khan.sms.MsgID;
import com.khan.util.SocketCommon;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class Registered_Delivery {
    public MsgID   Msg_Id        = null;  //  8   Unsigned Integer
    public String  Stat          = null;  //  7   Octet String
    public String  Submit_time   = null;  //  10  Octet String
    public String  Done_time     = null;  //  10  Octet String
    public String  Dest_NO       = null;  //  21  Octet String
    public int     SeqID         = 0;     //  4   Unsigned Integer


    public Registered_Delivery(byte[] data) {
        int ioffset=0;
        byte[] tmp = new byte[8] ;
        System.arraycopy(data, ioffset, tmp, 0, tmp.length);
        ioffset += tmp.length;
        Msg_Id = new MsgID(tmp);

        tmp = new byte[7];
        System.arraycopy(data, ioffset, tmp, 0, tmp.length);
        ioffset += tmp.length;
        Stat = new String(tmp).trim();

        tmp = new byte[10];
        System.arraycopy(data, ioffset, tmp, 0, tmp.length);
        ioffset += tmp.length;
        Submit_time = new String(tmp).trim();

        System.arraycopy(data, ioffset, tmp, 0, tmp.length);
        ioffset += tmp.length;
        Done_time = new String(tmp).trim();

        tmp = new byte[21];
        System.arraycopy(data, ioffset, tmp, 0, tmp.length);
        ioffset += tmp.length;
        Dest_NO = new String(tmp).trim();

        tmp = new byte[4];
        System.arraycopy(data, ioffset, tmp, 0, tmp.length);
        ioffset += tmp.length;
        SeqID = SocketCommon.getDWord(tmp, 0);
        //SeqID = MsgID.ntohl(SeqID);
    }

    public String toString() {
        return "REGISTERED_DELIVERY=[MsgID="+Msg_Id+",Stat="+Stat+",DestNO="+Dest_NO+"]" ;
    }

}

⌨️ 快捷键说明

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