📄 smssubmit.java
字号:
j=0;
while(j<body6.length){
b[i]=body6[j];
i++;
j++;
}
b[i]=body7;
i++;
j=0;
while(j<body8.length){
b[i]=body8[j];
i++;
j++;
}
j=0;
while(j<body9.length){
b[i]=body9[j];
i++;
j++;
}
b[i]=body10;
i++;
b[i]=body11;
i++;
b[i]=body12;
i++;
j=0;
while(j<body13.length){
b[i]=body13[j];
i++;
j++;
}
j=0;
while(j<body14.length){
b[i]=body14[j];
i++;
j++;
}
b[i]=body15;
i++;
b[i]=body16;
i++;
b[i]=body17;
i++;
b[i]=body18;
i++;
b[i]=body19;
i++;
j=0;
while(j<body20.length){
b[i]=body20[j];
i++;
j++;
}
j=0;
while(j<body21.length){
b[i]=body21[j];
i++;
j++;
}
j=0;
while(j<body22.length){
b[i]=body22[j];
i++;
j++;
}
m_os.write(b);
// System.out.println("x"+System.currentTimeMillis());
// SMSSubmitThread smssubmitthread=new SMSSubmitThread(seqAddr,seqDate,sequence,messageLength,commandID,
// spNumber,chargeNumber,userCount,userNumber,corpId,
// serviceType,feeType,feeValue,givenValue,agentFlag,
// morelatetoMTFlag,priority,expireTime,scheduleTime,reportFlag,
// tp_pid,tp_udhi,messageCoding,messageType,msgLen,
// messageContent,reserve);
// Thread newThread = new Thread(smssubmitthread);
// newThread.start();
// System.out.println("y"+System.currentTimeMillis());
// System.out.println("----------submit begin----------");
// System.out.println("messageLength:"+messageLength);
// System.out.println("commandID:"+commandID);
// System.out.println("seqAddr:"+seqAddr);
// System.out.println("seqDate:"+seqDate);
// System.out.println("sequence:"+sequence);
//
// System.out.println("userNumber:"+userNumber);
// System.out.println("spNumber:"+spNumber);
// System.out.println("tp_pid:"+tp_pid);
// System.out.println("tp_udhi:"+tp_udhi);
// System.out.println("messageCoding:"+messageCoding);
// System.out.println("msgLen:"+msgLen);
// System.out.println("messageContent:"+messageContent);
// System.out.println("morelatetoMTFlag:"+morelatetoMTFlag);
// System.out.println("feeType:"+feeType);
// System.out.println("reportFlag:"+reportFlag);
// System.out.println("reserve:"+reserve);
// System.out.println("----------submit end----------");
}
public synchronized void writeBinary(DataOutputStream m_os) throws SgipException,IOException{
int i=0;
int j=0;
this.msgLen=binaryMessageContent.length;
this.messageLength=20+144+msgLen;
this.commandID=CommandID.SGIP_SUBMIT;
byte b[] = new byte[messageLength];
/* head */
byte[] head1 = getInteger4(messageLength);
byte[] head2=getInteger4(commandID);
byte[] head3=getInteger4(seqAddr);
byte[] head4=getInteger4(seqDate);
byte[] head5=getInteger4(sequence);
/* body */
byte[] body1 = getText(21,spNumber);
byte[] body2 = getText(21,chargeNumber);
byte body3 = getInteger1(userCount);
byte[] body4 = getText(21,userNumber);
byte[] body5 = getText(5,corpId);
byte[] body6 = getText(10,serviceType);
byte body7 = getInteger1(feeType);
byte[] body8 = getText(6,feeValue);
byte[] body9 = getText(6,givenValue);
byte body10 = getInteger1(agentFlag);
byte body11 = getInteger1(morelatetoMTFlag);
byte body12 = getInteger1(priority);
byte[] body13 = getText(16,expireTime);
byte[] body14 = getText(16,scheduleTime);
byte body15 = getInteger1(reportFlag);
byte body16 = getInteger1(tp_pid);
byte body17 = getInteger1(tp_udhi);
byte body18 = getInteger1(messageCoding);
byte body19 = getInteger1(messageType);
byte[] body20 = getInteger4(msgLen);
byte[] body21 = binaryMessageContent;
byte[] body22 = getText(8,reserve);
j=0;
while(j<head1.length){
b[i]=head1[j];
i++;
j++;
}
j=0;
while(j<head2.length){
b[i]=head2[j];
i++;
j++;
}
j=0;
while(j<head3.length){
b[i]=head3[j];
i++;
j++;
}
j=0;
while(j<head4.length){
b[i]=head4[j];
i++;
j++;
}
j=0;
while(j<head5.length){
b[i]=head5[j];
i++;
j++;
}
j=0;
while(j<body1.length){
b[i]=body1[j];
i++;
j++;
}
j=0;
while(j<body2.length){
b[i]=body2[j];
i++;
j++;
}
b[i] = body3;
i++;
j=0;
while(j<body4.length){
b[i]=body4[j];
i++;
j++;
}
j=0;
while(j<body5.length){
b[i]=body5[j];
i++;
j++;
}
j=0;
while(j<body6.length){
b[i]=body6[j];
i++;
j++;
}
b[i]=body7;
i++;
j=0;
while(j<body8.length){
b[i]=body8[j];
i++;
j++;
}
j=0;
while(j<body9.length){
b[i]=body9[j];
i++;
j++;
}
b[i]=body10;
i++;
b[i]=body11;
i++;
b[i]=body12;
i++;
j=0;
while(j<body13.length){
b[i]=body13[j];
i++;
j++;
}
j=0;
while(j<body14.length){
b[i]=body14[j];
i++;
j++;
}
b[i]=body15;
i++;
b[i]=body16;
i++;
b[i]=body17;
i++;
b[i]=body18;
i++;
b[i]=body19;
i++;
j=0;
while(j<body20.length){
b[i]=body20[j];
i++;
j++;
}
j=0;
while(j<body21.length){
b[i]=body21[j];
i++;
j++;
}
j=0;
while(j<body22.length){
b[i]=body22[j];
i++;
j++;
}
m_os.write(b);
// SMSSubmitThread smssubmitthread=new SMSSubmitThread(seqAddr,seqDate,sequence,messageLength,commandID,
// spNumber,chargeNumber,userCount,userNumber,corpId,
// serviceType,feeType,feeValue,givenValue,agentFlag,
// morelatetoMTFlag,priority,expireTime,scheduleTime,reportFlag,
// tp_pid,tp_udhi,messageCoding,messageType,msgLen,
// messageContent,reserve);
// Thread newThread = new Thread(smssubmitthread);
// newThread.start();
}
public int getMsgLen() {
return msgLen;
}
public void setMsgLen(int newMsgLen) {
msgLen = newMsgLen;
}
public synchronized void read(DataInputStream m_is) throws SgipException,IOException {
int i=0;
byte[] head1=new byte[4];
head1[0]=m_is.readByte();
head1[1]=m_is.readByte();
head1[2]=m_is.readByte();
head1[3]=m_is.readByte();
this.messageLength=(head1[0] & 0xff) << 24 | (head1[1] & 0xff) << 16 | (head1[2] & 0xff) << 8 | head1[3] & 0xff;
byte[] head2=new byte[4];
head2[0]=m_is.readByte();
head2[1]=m_is.readByte();
head2[2]=m_is.readByte();
head2[3]=m_is.readByte();
this.commandID=(head2[0] & 0xff) << 24 | (head2[1] & 0xff) << 16 | (head2[2] & 0xff) << 8 | head2[3] & 0xff;
// if(this.commandID!=CommandID.SGIP_DELIVER){
// throw new SgipException();
// }
byte[] head3=new byte[4];
head3[0]=m_is.readByte();
head3[1]=m_is.readByte();
head3[2]=m_is.readByte();
head3[3]=m_is.readByte();
this.seqAddr=(head3[0] & 0xff) << 24 | (head3[1] & 0xff) << 16 | (head3[2] & 0xff) << 8 | head3[3] & 0xff;
byte[] head4=new byte[4];
head4[0]=m_is.readByte();
head4[1]=m_is.readByte();
head4[2]=m_is.readByte();
head4[3]=m_is.readByte();
this.seqDate=(head4[0] & 0xff) << 24 | (head4[1] & 0xff) << 16 | (head4[2] & 0xff) << 8 | head4[3] & 0xff;
byte[] head5=new byte[4];
head5[0]=m_is.readByte();
head5[1]=m_is.readByte();
head5[2]=m_is.readByte();
head5[3]=m_is.readByte();
this.sequence=(head5[0] & 0xff) << 24 | (head5[1] & 0xff) << 16 | (head5[2] & 0xff) << 8 | head5[3] & 0xff;
i=0;
byte[] body1=new byte[21];
while(i<body1.length){
body1[i]=m_is.readByte();
i++;
}
this.spNumber=new String(body1);
i=0;
byte[] body2=new byte[21];
while(i<body2.length){
body2[i]=m_is.readByte();
i++;
}
this.chargeNumber=new String(body2);
byte body3=m_is.readByte();
this.userCount=body3;
i=0;
byte[] body4=new byte[21];
while(i<body4.length){
body4[i]=m_is.readByte();
i++;
}
this.userNumber=new String(body4);
i=0;
byte[] body5=new byte[5];
while(i<body5.length){
body5[i]=m_is.readByte();
i++;
}
this.corpId=new String(body5);
i=0;
byte[] body6=new byte[10];
while(i<body6.length){
body6[i]=m_is.readByte();
i++;
}
this.serviceType=new String(body6);
byte body7=m_is.readByte();
this.feeType=body7;
i=0;
byte[] body8=new byte[6];
while(i<body8.length){
body8[i]=m_is.readByte();
i++;
}
this.feeValue=new String(body8);
i=0;
byte[] body9=new byte[6];
while(i<body9.length){
body9[i]=m_is.readByte();
i++;
}
this.givenValue=new String(body9);
byte body10=m_is.readByte();
this.agentFlag=body10;
byte body11=m_is.readByte();
this.morelatetoMTFlag=body11;
byte body12=m_is.readByte();
this.priority=body12;
i=0;
byte[] body13=new byte[16];
while(i<body13.length){
body13[i]=m_is.readByte();
i++;
}
this.expireTime=new String(body13);
i=0;
byte[] body14=new byte[16];
while(i<body14.length){
body14[i]=m_is.readByte();
i++;
}
this.scheduleTime=new String(body14);
byte body15=m_is.readByte();
this.reportFlag=body15;
byte body16=m_is.readByte();
this.tp_pid=body16;
byte body17=m_is.readByte();
this.tp_udhi=body17;
byte body18=m_is.readByte();
this.messageCoding=body18;
byte body19=m_is.readByte();
this.messageType=body19;
byte[] body20=new byte[4];
body20[0]=m_is.readByte();
body20[1]=m_is.readByte();
body20[2]=m_is.readByte();
body20[3]=m_is.readByte();
this.msgLen=(body20[0] & 0xff) << 24 | (body20[1] & 0xff) << 16 | (body20[2] & 0xff) << 8 | body20[3] & 0xff;
i=0;
byte[] body21=new byte[msgLen];
while(i<body21.length){
body21[i]=m_is.readByte();
i++;
}
this.messageContent=new String(body21);
i=0;
byte[] body22=new byte[8];
while(i<body22.length){
body22[i]=m_is.readByte();
i++;
}
this.reserve=new String(body22);
// System.out.println("----------submit begin----------");
// System.out.println("messageLength:"+messageLength);
// System.out.println("commandID:"+commandID);
// System.out.println("seqAddr:"+seqAddr);
// System.out.println("seqDate:"+seqDate);
// System.out.println("sequence:"+sequence);
//
// System.out.println("userNumber:"+userNumber);
// System.out.println("spNumber:"+spNumber);
// System.out.println("tp_pid:"+tp_pid);
// System.out.println("tp_udhi:"+tp_udhi);
// System.out.println("messageCoding:"+messageCoding);
// System.out.println("msgLen:"+msgLen);
// System.out.println("messageContent:"+messageContent);
// System.out.println("morelatetoMTFlag:"+morelatetoMTFlag);
// System.out.println("feeType:"+feeType);
// System.out.println("reportFlag:"+reportFlag);
// System.out.println("reserve:"+reserve);
// System.out.println("----------submit end----------");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -