📄 submit.java
字号:
throw new SGIP_Exception("UserNumber longer than 21 bytes:" + s);
s.getBytes(0, s.length(), abyte1, 0);
SGIP_Command.BytesCopy(abyte1, bodybytes, 0, 20, i);
i += 21;
}
abyte1 = new byte[5];
if(CorpId.length() > 5)
throw new SGIP_Exception("CorpId longer than 5 bytes:" + CorpId);
CorpId.getBytes(0, CorpId.length(), abyte1, 0);
SGIP_Command.BytesCopy(abyte1, bodybytes, 0, 4, i);
i += 5;
abyte1 = new byte[10];
if(ServiceType.length() > 10)
throw new SGIP_Exception("ServiceType longer than 10 bytes:" + ServiceType);
ServiceType.getBytes(0, ServiceType.length(), abyte1, 0);
SGIP_Command.BytesCopy(abyte1, bodybytes, 0, 9, i);
i += 10;
bodybytes[i] = (byte)FeeType;
i++;
abyte1 = new byte[6];
if(FeeValue.length() > 6)
throw new SGIP_Exception("FeeValue longer than 6 bytes:" + FeeValue);
FeeValue.getBytes(0, FeeValue.length(), abyte1, 0);
SGIP_Command.BytesCopy(abyte1, bodybytes, 0, 5, i);
i += 6;
abyte1 = new byte[6];
if(GivenValue.length() > 6)
throw new SGIP_Exception("GivenValue longer than 6 bytes:" + GivenValue);
GivenValue.getBytes(0, GivenValue.length(), abyte1, 0);
SGIP_Command.BytesCopy(abyte1, bodybytes, 0, 5, i);
i += 6;
bodybytes[i] = (byte)AgentFlag;
i++;
bodybytes[i] = (byte)MOrelatetoMTFlag;
i++;
bodybytes[i] = (byte)Priority;
i++;
abyte1 = new byte[16];
if(ExpireTime.length() > 16)
throw new SGIP_Exception("EXpireTime longer than 16 bytes:" + ExpireTime);
ExpireTime.getBytes(0, ExpireTime.length(), abyte1, 0);
SGIP_Command.BytesCopy(abyte1, bodybytes, 0, 15, i);
i += 16;
abyte1 = new byte[16];
if(ScheduleTime.length() > 16)
{
throw new SGIP_Exception("ScheduleTime longer than 16 bytes:" + ScheduleTime);
} else
{
ScheduleTime.getBytes(0, ScheduleTime.length(), abyte1, 0);
SGIP_Command.BytesCopy(abyte1, bodybytes, 0, 15, i);
i += 16;
bodybytes[i] = (byte)ReportFlag;
i++;
bodybytes[i] = (byte)TP_pid;
i++;
bodybytes[i] = (byte)TP_udhi;
i++;
bodybytes[i] = (byte)MessageCoding;
i++;
bodybytes[i] = (byte)MessageType;
i++;
SGIP_Command.BytesCopy(SGIP_Command.IntToBytes4(ContentLength), bodybytes, 0, 3, i);
i += 4;
boolean flag = false;
SGIP_Command.BytesCopy(abyte0, bodybytes, 0, ContentLength - 1, i);
return;
}
}
public int getAgentFlag()
{
return AgentFlag;
}
public String getChargeNumber()
{
return ChargeNumber;
}
public String getCorpId()
{
return CorpId;
}
public String getExpireTime()
{
return ExpireTime;
}
public int getFeeType()
{
return FeeType;
}
public String getFeeValue()
{
return FeeValue;
}
public String getGivenValue()
{
return GivenValue;
}
public int getMOrelatetoMTFlag()
{
return MOrelatetoMTFlag;
}
public int getMessageCoding()
{
return MessageCoding;
}
public String getMessageContent()
{
return MessageContent;
}
public int getMessageLength()
{
return ContentLength;
}
public int getMessageType()
{
return MessageType;
}
public int getPriority()
{
return Priority;
}
public int getReportFlag()
{
return ReportFlag;
}
public String getSPNumber()
{
return SPNumber;
}
public String getScheduleTime()
{
return ScheduleTime;
}
public String getServiceType()
{
return ServiceType;
}
public int getTP_pid()
{
return TP_pid;
}
public int getTP_udhi()
{
return TP_udhi;
}
public int getUserCount()
{
return UserCount;
}
public String[] getUserNumber()
{
return usernumber;
}
public void setAgentFlag(int agentFlag)
{
AgentFlag = agentFlag;
}
public int setBinContent(int contLen, String HexString)
{
MessageCoding = 4;
ContentLength = contLen;
BinContent = new byte[contLen];
byte abyte0[] = HexStringToBytes(HexString);
SGIP_Command.BytesCopy(abyte0, BinContent, 0, contLen - 1, 0);
return 0;
}
public int setBinContent(int i, byte abyte0[])
{
MessageCoding = 4;
ContentLength = i;
BinContent = new byte[i];
SGIP_Command.BytesCopy(abyte0, BinContent, 0, i - 1, 0);
return 0;
}
public void setChargeNumber(String chargeNum)
{
ChargeNumber = chargeNum;
}
public int setContent(int Coding, String content)
{
if(content != null)
{
if(Coding == 4)
if(content.getBytes().length > 160)
{
MessageContent = content.substring(0, 160);
return -1;
} else
{
MessageContent = content;
return setBinContent((content.length() - 1) / 2, content);
}
MessageCoding = Coding;
if(content.getBytes().length > 160)
{
if(MessageCoding == 15)
MessageContent = content.substring(0, 80);
else
MessageContent = content.substring(0, 160);
return -1;
} else
{
MessageContent = content;
return 0;
}
} else
{
return 0;
}
}
public void setCorpId(String corpId)
{
CorpId = corpId;
}
public void setExpireTime(String expireTime)
{
ExpireTime = expireTime;
}
public void setFeeType(int feeType)
{
FeeType = feeType;
}
public void setFeeValue(String feeValue)
{
FeeValue = feeValue;
}
public void setGivenValue(String givenValue)
{
GivenValue = givenValue;
}
public void setMOrelatetoMTFlag(int moRelateToMtFlag)
{
MOrelatetoMTFlag = moRelateToMtFlag;
}
public void setMessageType(int messageType)
{
MessageType = messageType;
}
public void setPriority(int priority)
{
Priority = priority;
}
public void setReportFlag(int reportFlag)
{
ReportFlag = reportFlag;
}
public void setSPNumber(String spNum)
{
SPNumber = spNum;
}
public void setScheduleTime(String scheduleTime)
{
ScheduleTime = scheduleTime;
}
public void setServiceType(String serviceType)
{
ServiceType = serviceType;
}
public void setTP_pid(int tp_pid)
{
TP_pid = tp_pid;
}
public void setTP_udhi(int tp_udhi)
{
TP_udhi = tp_udhi;
}
public int setUserNumber(String userNum)
throws SGIP_Exception
{
if(userNum.length() == 0)
return 1;
UserCount = 0;
for(int i = 0; i < userNum.length(); i++)
{
char c = userNum.charAt(i);
if(c != ',' && (c < '0' || c > '9'))
throw new SGIP_Exception("Invalid Mobile Number");
if(c == ',')
UserCount++;
}
UserCount++;
usernumber = new String[UserCount];
boolean flag = false;
int l = 0;
for(int j = 0; j < UserCount - 1; j++)
{
int k = l;
l = userNum.indexOf(44, l + 1);
usernumber[j] = userNum.substring(k, l);
l++;
}
usernumber[UserCount - 1] = userNum.substring(l, userNum.length());
return 0;
}
public int write(OutputStream outputstream)
{
if(MessageCoding == 4)
SetBinBody();
else
SetMsgBody();
super.write(outputstream);
return 0;
Exception exception;
exception;
System.out.println(exception.toString());
return -1;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -