?? tailinfo.java
字號:
package com.hoten.tail;
import java.net.*;
import java.io.*;
/**
* <p>Title: MOInfo</p>
* <p>Description:MO消息類主要是封裝了一個MO消息,此類中的數據結構跟數據庫中
* 表UI_MO和WS_MO完全一樣。此類有兩種方法,get和set主要是對里面的屬性進行操作。</p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company:Hoten</p>
* @version 1.0
*/
public class TailInfo {
private int port; //目標服務器監聽端口
private String hostIP; //目標IP或名稱
private byte[] _startFlag; //開始標志
private byte[] _program; //消息時間
private byte[] _pType; //手機號碼
private byte[] _mType; //消息內容
private byte[] _msg; //業務類別 :9555
private byte[] _endFlag; //備份是需要的業務類別 :010
/** 設置_startFlag */
public void setStartFlag(String startFlag){
_startFlag = new byte[4];
System.arraycopy(startFlag.getBytes(),0,_startFlag,0,4);
}
/** 設置program */
public void setProgram(String program){
_program = new byte[4];
System.arraycopy(program.getBytes(),0,_program,0,4);
}
/** 設置_pType */
public void setPType(String pType){
_pType = new byte[1];
System.arraycopy(pType.getBytes(),0,_pType,0,1);
}
/** 設置_mType */
public void setMType(String mType){
_mType = new byte[1];
System.arraycopy(mType.getBytes(),0,_mType,0,1);
}
/** 設置_msg */
public void setMsg(String msg){
try {
_msg = msg.getBytes("gb2312");
}
catch (Exception ex) {
_msg = msg.getBytes();
}
}
/** 設置_endFlag */
public void setEndFlag(String endFlag){
_endFlag = new byte[4];
System.arraycopy(endFlag.getBytes(),0,_endFlag,0,4);
}
public byte[] getData(){
byte[] data = new byte[14+_msg.length];
System.arraycopy(this._startFlag,0,data,0,4);
System.arraycopy(this._program,0,data,4,4);
data[8] = _pType[0];
data[9] = _mType[0];
System.arraycopy(this._msg,0,data,10,_msg.length);
System.arraycopy(this._endFlag,0,data,10+_msg.length,4);
return data;
}
public String getHost(){
return hostIP;
}
public int getPort(){
return port;
}
public void setHost(String ip){
this.hostIP=ip;
}
public void setPort(int port){
this.port=port;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -