cmppconnectrep.java
来自「短信系统SMS:支持普通短信、长短信和wap push短信的发送。」· Java 代码 · 共 60 行
JAVA
60 行
package com.ekun.sms.cmpp2;
public class CmppConnectRep
{
public CmppConnectRep(byte bodys[], int bodylens)
{
this.bodylens = bodylens;
bodybytes = new byte[bodylens];
status = -1;
version = -1;
AuthenticatorISMG = "";
bodybytes = new byte[bodylens];
int i = 0;
for (i = 0; i < bodylens; i++)
{
bodybytes[i] = bodys[i];
}
}
public int getStatus()
{
byte tmp = bodybytes[0];
status = (int) tmp;
return status;
}
public int getVersion()
{
byte tmp = bodybytes[17];
version = (int) tmp;
return version;
}
public String getAuthenticatorISMG()
{
StringBuffer sb = new StringBuffer();
int i = 1;
for (i = 1; i < 17; i++)
{
char chr = (char) bodybytes[i];
sb.append(chr);
}
AuthenticatorISMG = sb.toString();
return AuthenticatorISMG;
}
byte bodybytes[]; /*包体*/
int bodylens;
int status; //0:正确1:消息结构错 2:非法SP_ID 3:SP认证错 4:版本太高 5~ :其他错误
String AuthenticatorISMG;
int version;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?