📄 defaultcngpcommu.java
字号:
package com.gctech.cngphb;
import java.io.IOException;
import java.net.Socket;
import com.gctech.cngphb.util.SequenceManager;
import com.gctech.cngphb.msg.Constants;
import com.gctech.cngphb.util.CNGPTimestampFormat;
import java.io.DataOutputStream;
import java.io.DataInputStream;
import java.io.InputStream;
import org.apache.log4j.Logger;
import com.gctech.cngphb.msg.CNGPSubmitMessage;
import com.gctech.cngphb.msg.CNGPHead;
import com.gctech.cngphb.msg.CNGPDeliverMessageResp;
import java.io.OutputStream;
import com.gctech.util.MD5;
import com.gctech.util.Tools;
/**
* <p>Title: CNGP API缺省实现.</p>
* <p>Description: 固网短信SP API缺省实现.</p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: GCTECH</p>
* @author 王红宝
* @version $Id: DefaultCngpCommu.java,v 1.1.1.1 2004/07/26 02:44:14 lijz Exp $
*/
public class DefaultCngpCommu extends AbstractCngpCommu {
protected byte[] getPlain(String clientId, String auth, String time){
//int plainLength = clientId.length() + 7 + auth.length() + 10;
//clientId定长
int plainLength = 10 + 7 + auth.length() + 10;
byte[] plain = new byte[plainLength];
byte[] temp = clientId.getBytes();
System.arraycopy(temp, 0, plain, 0, temp.length);
//int start = clientId.length() + 7;
int start = 10 + 7;
temp = auth.getBytes();
System.arraycopy(temp, 0, plain, start, temp.length);
start += auth.length();
temp = time.getBytes();
System.arraycopy(temp, 0, plain, start, temp.length);
return plain;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -