?? defaultcngpcommu.java
字號:
package com.gctech.cngp;
import java.io.IOException;
import java.net.Socket;
import com.gctech.cngp.util.SequenceManager;
import com.gctech.cngp.msg.Constants;
import com.gctech.cngp.util.CNGPTimestampFormat;
import java.io.DataOutputStream;
import java.io.DataInputStream;
import java.io.InputStream;
import org.apache.log4j.Logger;
import com.gctech.cngp.msg.CNGPSubmitMessage;
import com.gctech.cngp.msg.CNGPHead;
import com.gctech.cngp.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.2 2004/05/09 05:12:35 wanghb 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 + -