📄 submit.java
字号:
Priority = j1;
ExpireTime = s7;
ScheduleTime = s8;
ReportFlag = k1;
TP_pid = l1;
TP_udhi = i2;
MessageCoding = j2;
MessageType = k2;
MessageContent = s9;
}// throws SGIP_Exception 结束// throws SGIP_Exception 结束
public Submit(long l, String s, String s1, int i, String s2, String s3,
String s4, int j, String s5, String s6, int k, int i1, int j1,
String s7, String s8, int k1, int l1, int i2, int j2, int k2,
int l2, byte abyte0[])
throws SGIP_Exception
{
super(l);
NodeID = 0L;
ContentLength = 0;
NodeID = l;
SPNumber = s;
ChargeNumber = s1;
UserCount = 0;
for(int i3 = 0; i3 < s2.length(); i3++)
{
char c = s2.charAt(i3);
if(c != ',' && (c < '0' || c > '9'))
throw new SGIP_Exception("Invalid Mobile Number");
if(c == ',')
UserCount++;
}
UserCount++;
if(UserCount > 100)
throw new SGIP_Exception("Too many users!");
usernumber = new String[UserCount];
boolean flag = false;
int l3 = 0;
for(int j3 = 0; j3 < UserCount - 1; j3++)
{
int k3 = l3;
l3 = s2.indexOf(44, l3 + 1);
usernumber[j3] = s2.substring(k3, l3);
l3++;
}
usernumber[UserCount - 1] = s2.substring(l3, s2.length());
CorpId = s3;
ServiceType = s4;
FeeType = j;
FeeValue = s5;
GivenValue = s6;
AgentFlag = k;
MOrelatetoMTFlag = i1;
Priority = j1;
ExpireTime = s7;
ScheduleTime = s8;
ReportFlag = k1;
TP_pid = l1;
TP_udhi = i2;
MessageCoding = j2;
MessageType = k2;
ContentLength = l2;
BinContent = new byte[l2];
SGIP_Command.BytesCopy(abyte0, BinContent, 0, ContentLength - 1, 0);
}// throws SGIP_Exception 结束// throws SGIP_Exception 结束
private void SetMsgBody()
throws SGIP_Exception
{
byte abyte0[] = null;
try
{
if(MessageCoding == 15)
{
abyte0 = MessageContent.getBytes("GBK");
ContentLength = abyte0.length;
}
else
{
ContentLength = MessageContent.length();
}
}
catch(Exception exception)
{
System.out.println("chinese code error:" + exception.toString());
}
TotalLength = 143 + 21 * UserCount + ContentLength;
head.setTotalLength(TotalLength);
head.setCommandID(3);
head.setSeq_1(SGIP_Command.seq.getGlobalSeq_1());
head.setSeq_2(SGIP_Command.seq.getGlobalSeq_2());
head.setSeq_3(SGIP_Command.seq.getGlobalSeq_3());
bodybytes = new byte[TotalLength - 20];
byte abyte1[] = new byte[21];
if(SPNumber.length() > 21)
throw new SGIP_Exception("SPNumber Longer than 21 bytes:" + SPNumber);
SPNumber.getBytes(0, SPNumber.length(), abyte1, 0);
SGIP_Command.BytesCopy(abyte1, bodybytes, 0, 20, 0);
abyte1 = new byte[21];
if(ChargeNumber.length() > 21)
throw new SGIP_Exception("ChargeNumber longer than 21 bytes:" + ChargeNumber);
ChargeNumber.getBytes(0, ChargeNumber.length(), abyte1, 0);
SGIP_Command.BytesCopy(abyte1, bodybytes, 0, 20, 21);
bodybytes[42] = (byte)UserCount;
UserCount = UserCount;
int i = 43;
for(int j = 0; j < UserCount; j++)
{
abyte1 = new byte[21];
String s = new String(usernumber[j]);
if(s.length() > 21)
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);
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;
if(MessageCoding == 15)
SGIP_Command.BytesCopy(abyte0, bodybytes, 0, ContentLength - 1, i);
else
MessageContent.getBytes(0, ContentLength, bodybytes, i);
}// throws SGIP_Exception 结束// throws SGIP_Exception 结束
private void SetBinBody()
throws SGIP_Exception
{
TotalLength = 143 + 21 * UserCount + ContentLength;
if(SGIP_Command.seq == null)
{
SGIP_Command.seq = new Seq();
SGIP_Command.seq.setNodeId(NodeID);
Seq.computeSequence();
}
head.setTotalLength(TotalLength);
head.setCommandID(3);
head.setSeq_1(SGIP_Command.seq.getGlobalSeq_1());
head.setSeq_2(SGIP_Command.seq.getGlobalSeq_2());
head.setSeq_3(SGIP_Command.seq.getGlobalSeq_3());
bodybytes = new byte[TotalLength - 20];
byte abyte0[] = new byte[21];
if(SPNumber.length() > 21)
throw new SGIP_Exception("SPNumber Longer than 21 bytes:" + SPNumber);
SPNumber.getBytes(0, SPNumber.length(), abyte0, 0);
SGIP_Command.BytesCopy(abyte0, bodybytes, 0, 20, 0);
abyte0 = new byte[21];
if(ChargeNumber.length() > 21)
throw new SGIP_Exception("ChargeNumber longer than 21 bytes:" + ChargeNumber);
ChargeNumber.getBytes(0, ChargeNumber.length(), abyte0, 0);
SGIP_Command.BytesCopy(abyte0, bodybytes, 0, 20, 21);
bodybytes[42] = (byte)UserCount;
int i = 43;
for(int j = 0; j < UserCount; j++)
{
abyte0 = new byte[21];
String s = new String(usernumber[j]);
if(s.length() > 21)
throw new SGIP_Exception("UserNumber longer than 21 bytes:" + s);
s.getBytes(0, s.length(), abyte0, 0);
SGIP_Command.BytesCopy(abyte0, bodybytes, 0, 20, i);
i += 21;
}
abyte0 = new byte[5];
if(CorpId.length() > 5)
throw new SGIP_Exception("CorpId longer than 5 bytes:" + CorpId);
CorpId.getBytes(0, CorpId.length(), abyte0, 0);
SGIP_Command.BytesCopy(abyte0, bodybytes, 0, 4, i);
i += 5;
abyte0 = new byte[10];
if(ServiceType.length() > 10)
throw new SGIP_Exception("ServiceType longer than 10 bytes:" + ServiceType);
ServiceType.getBytes(0, ServiceType.length(), abyte0, 0);
SGIP_Command.BytesCopy(abyte0, bodybytes, 0, 9, i);
i += 10;
bodybytes[i] = (byte)FeeType;
i++;
abyte0 = new byte[6];
if(FeeValue.length() > 6)
throw new SGIP_Exception("FeeValue longer than 6 bytes:" + FeeValue);
FeeValue.getBytes(0, FeeValue.length(), abyte0, 0);
SGIP_Command.BytesCopy(abyte0, bodybytes, 0, 5, i);
i += 6;
abyte0 = new byte[6];
if(GivenValue.length() > 6)
throw new SGIP_Exception("GivenValue longer than 6 bytes:" + GivenValue);
GivenValue.getBytes(0, GivenValue.length(), abyte0, 0);
SGIP_Command.BytesCopy(abyte0, bodybytes, 0, 5, i);
i += 6;
bodybytes[i] = (byte)AgentFlag;
i++;
bodybytes[i] = (byte)MOrelatetoMTFlag;
i++;
bodybytes[i] = (byte)Priority;
i++;
abyte0 = new byte[16];
if(ExpireTime.length() > 16)
throw new SGIP_Exception("EXpireTime longer than 16 bytes:" + ExpireTime);
ExpireTime.getBytes(0, ExpireTime.length(), abyte0, 0);
SGIP_Command.BytesCopy(abyte0, bodybytes, 0, 15, i);
i += 16;
abyte0 = new byte[16];
if(ScheduleTime.length() > 16)
{
throw new SGIP_Exception("ScheduleTime longer than 16 bytes:" + ScheduleTime);
}
else
{
ScheduleTime.getBytes(0, ScheduleTime.length(), abyte0, 0);
SGIP_Command.BytesCopy(abyte0, 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;
SGIP_Command.BytesCopy(BinContent, bodybytes, 0, ContentLength - 1, i);
return;
}
}// throws SGIP_Exception 结束// throws SGIP_Exception 结束
public int write(OutputStream outputstream)
{
try
{
if(MessageCoding == 4)
SetBinBody();
else
SetMsgBody();
super.write(outputstream);
return 0;
}
catch(Exception exception)
{
System.out.println(exception.toString());
}
return -1;
} // Java 204 代码风格版本 : 6.0 < 类Fox Lin C++ 风格 >}// class Submit extends SGIP_Command 结束// 主类结束// class Submit extends SGIP_Command 结束// 主类结束
/*********提高国人Java水平,从你做起,从我做起,我看不如从Java204做起....*********//*联系我们 : 地址 : 北京市北方交通大学电气99-2班 29号信箱 邮编 : 100044 电话 : 010-63223904 或 13641045686 RFB : 冯霖 补充 : 我在16204宿舍住 :) *//*谢谢选择RainForest的产品,请多支持我们,我们会把更多更强的BOSS级工具奉献给用户*//*********提高国人Java水平,从你做起,从我做起,我看不如从Java204做起....*********//*联系我们 : 地址 : 北京市北方交通大学电气99-2班 29号信箱 邮编 : 100044 电话 : 010-63223904 或 13641045686 RFB : 冯霖 补充 : 我在16204宿舍住 :) *//*谢谢选择RainForest的产品,请多支持我们,我们会把更多更强的BOSS级工具奉献给用户*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -