⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmpp3connectresp.java

📁 java支持的短信平台
💻 JAVA
字号:
package com.khan.sms.cmpp3;

import com.khan.util.SocketCommon;

public class Cmpp3ConnectResp extends Cmpp3Data {
  public byte  bStatus = (byte)0xFF;
  byte[] AuthenticatorISMG = new byte[16];
  byte bVersion = 0x00;


  public Cmpp3ConnectResp(byte[] data) {
      //MsgID.PrintDataHex(data);//
      if (data.length < 12)
          throw new ExceptionInInitializerError("数据包长度小于12字节,包错误!");
      int ioffset = 0;
      TotalLen = SocketCommon.getDWord(data, ioffset);//MsgID.ntohl( MsgID.getDWord(data, ioffset) );
      //System.out.println(TotalLen);//
      if (data.length < 12)
         throw new ExceptionInInitializerError("数据包头Total_Len字段标示长度小于12字节,包头错误!");

      ioffset += 4;
      CommandID =  SocketCommon.getDWord(data, ioffset);//MsgID.ntohl( MsgID.getDWord(data, ioffset) );
      ioffset += 4;
      SeqID =  SocketCommon.getDWord(data, ioffset);//MsgID.ntohl( MsgID.getDWord(data, ioffset) );
      ioffset += 4;

      Data = new byte[TotalLen - ioffset];
      System.arraycopy(data, ioffset, Data,0, TotalLen - ioffset);
  }

  /**
   * decodeCmpp
   *
   * @return Cmpp2Data
   * @todo Implement this com.khan.sms.cmpp2.Cmpp2Data method
   */
  public Cmpp3Data decodeCmpp() {
      int ioffset=0;
      this.bStatus = this.Data[0];
      ioffset += 1;

      System.arraycopy(Data, ioffset, AuthenticatorISMG, 0, AuthenticatorISMG.length);
      ioffset += AuthenticatorISMG.length;

      bVersion = Data[ioffset];

      Cmpp3Data connect_resp  = this ;
      return connect_resp;
  }

  /**
   * encodeCmpp
   *
   * @return byte[]
   * @todo Implement this com.khan.sms.cmpp2.Cmpp2Data method
   */
  public byte[] encodeCmpp() {
      return null;
  }



  public String toString() {
      return "CMPP3_CONNECT_RESP:status="+this.bStatus+",Version="+ this.bVersion ;
    }

}

⌨️ 快捷键说明

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