js继承

js 文件注释方法 /** +enter

js中的对象方法 类方法(类似静态方法) 原型方法

  • 类方法可直接调用 常用于生成对象 类似后端getInstance
1
2
3
Histogrm.create = function(wnd, container, bname, count) {
return new Histogrm(wnd, container, bname, count);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function People(name)  
{
this.name=name;
//对象方法
this.Introduce=function(){
alert("My name is "+this.name);
}
}
//类方法
People.Run=function(){
alert("I can run");
}
//原型方法
People.prototype.IntroduceChinese=function(){
alert("我的名字是"+this.name);
}
//测试
var p1=new People("Windking");

p1.Introduce(); //对象方法需要通过实例化对象去调用

People.Run(); //类方法不需要通过实例化对象去调用

p1.IntroduceChinese(); //原型方法也需要通过实例化对象去调用

作业中存在的问题

  • 前台url全部小写
  • 文档注释
  • 方法注释
  • 全部封装成对象 而不是部分封装
  • dao层要改成getInstands获取实例
  • action层 命名 Action+名字
  • 异常抛出到action层
  • 不要写太多action 通过cmd参数选择执行
  • debugger systom.out.println()要去掉
  • this.wnd this.doc
  • 销毁
  • this
  • bind绑事件 call aplly
  • setOnClick(this.aaa().bind(this));//方法100行 多啦之后套用 bind可以吧this传入

js继承怎么写

  • 页面中调用

    1
    2
    3
    4
    <script>
    var bookmain = new bookmain(this.wnd, document.body);
    bookmain.dispose();
    </script>
  • 具体js对象

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    /**
    *
    * @param wnd
    * @param parentElement
    * @returns
    */

    function bookmain(wnd, parentElement) {
    XComponent.call(this, wnd, parentElement);
    this._initTestPage();
    }

    extendClass(bookmain, XComponent, "bookmain");
    var list;//列表




    /**
    * 销毁方法
    */
    bookmain.prototype.dispose = function() {
    if (this.sp) {
    this.sp.dispose();
    this.sp = null;
    }
    if (this.tree) {
    this.tree.dispose();
    this.tree = null;
    }
    if (this.his) {
    this.his.dispose();
    this.his = null;
    }
    if (this.pageCtrl) {
    this.pageCtrl.dispose();
    this.pageCtrl = null;
    }
    if (this.list) {
    this.list.dispose();
    this.list = null;
    }
    XComponent.prototype.dispose.call(this);
    }

    /**
    * 初始化方法
    */
    bookmain.prototype._initTestPage = function() {
    // ----------------------------xsplitter----------------------
    var sp = XPanelSplitter.createWithDom(document.getElementById("testdom"));
    sp.setFixedPanel(1, 200);

    // ----------------------------xtree--------------------------
    var tree = new XTree(window, document.getElementById("left-div"), "100%", "100%");
    var root = tree.getRootItem();
    var map = new Map();
    map.put("action", "main");
    QueryObj.create("index.do", map, function(query){
    try {
    query.checkResult();
    var res = query.getResponseJSON();
    for(var i = 0; i < res.length; i++){
    var a = res[i];
    var b = a.split(",");
    var item = root.appendChild(b[0]);
    item.setHasChildren(true);
    item.setUserObj({
    id : b[1]
    });
    }
    } catch(e) {
    hideWaitDialog();
    showError(e);
    }
    });

    //节点展开
    tree.setOnExpand(function(item){
    item.clearChildren();
    var params = new Map();
    params.put("cid",item.userObj.id);
    params.put("action", "tree");
    QueryObj.create("index.do", params, function(query){
    try {
    query.checkResult();
    var res = query.getResponseJSON();
    for(var i = 0; i < res.length; i++){
    //添加子节点
    var a = res[i];
    var b = a.split(",");
    var childitem = item.appendChild(b[0]);
    childitem.setUserObj({
    id : b[1]
    });
    }
    } catch(e) {
    hideWaitDialog();
    showError(e);
    }
    });

    });
    this._createXtabctrl();
    this._createXlist();
    //绑定点击事件
    tree.setOnClick(function(item, event){
    var tid = item.userObj.id;
    //alert(tid);
    var params = new Map();
    params.put("tid",tid);
    params.put("action","display");
    QueryObj.create("index.do", params, function(query){
    try {
    query.checkResult();
    var res = query.getResponseJSON();
    if(document.getElementById("mytable") != null){
    var dom1 = document.getElementById("div_count");
    var child = document.getElementById("mytable");
    dom1.removeChild(child);
    //dom1.innerHTML = "";
    list.clear();
    }
    var mytable=document.createElement("table");
    mytable.setAttribute("id","mytable");
    var row1=mytable.insertRow(-1);
    for(var i = 0; i < res.length; i++){
    var a = res[i];
    var b = a.split(",");
    //添加列表
    list.addRow(b[0], b[1], b[2], b[3]);
    if( i == 0){
    var bname = b[0];
    var count = b[4];
    var cell=row1.insertCell(-1);
    var his=new Histogrm(window,cell,bname,count);
    }else if(res[i].split(",")[0] != res[i-1].split(",")[0]){
    var bname = b[0];
    var count = b[4];
    var cell = row1.insertCell(-1);
    var his = new Histogrm(window,cell,bname,count);
    }
    }
    div_count.appendChild(mytable);

    } catch(e) {
    hideWaitDialog();
    showError(e);
    }
    });

    });
    }
    /**
    * 构建页面选择按钮
    */
    bookmain.prototype._createXtabctrl = function() {
    //右表显示
    var pageCtrl = new XPageControl(window, document.getElementById("right-div"));
    //列表
    var div_table = document.createElement("div");
    div_table.setAttribute("id","div_table");
    pageCtrl.addPage(I18N.getString("test.web.study.test.ftl.jyjl","借阅记录"), "").appendChild(div_table);

    //图形
    var div_count = document.createElement("div");
    div_count.setAttribute("id","div_count");
    pageCtrl.addPage(I18N.getString("test.web.study.test.ftl.tjfx","统计分析"), "").appendChild(div_count);

    pageCtrl.setActive(0);


    }
    /**
    * 构建列表
    *
    */

    bookmain.prototype._createXlist = function() {
    var columns = [["书名", "25%"], ["借阅人", "25%"], ["借阅时间", "25%"], ["归还时间", "25%"]];
    list = new XList(window,document.getElementById("div_table"),"100%","100%");
    list.enableThreeState(true);
    list.setSortable(true);
    list.setMouseOver(true);
    list.setTextSelected(false);
    list.setDraggable(true);
    list.setDropable(true);
    list.setColorEvenRows(true);
    list.setAllTextCell(false);
    list.initWithColumns(columns);

    }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function splitter(wnd, parentElement) {
XComponent.call(this, wnd, parentElement);
this._initTestPage();
}
//继承
extendClass(splitter, XComponent, "xpanelsplitter");

//初始化方法
splitter.prototype._initTestPage = function() {
var sp = XPanelSplitter.createWithDom(document.getElementById("testdom"));
sp.setFixedPanel(1, 200);

}
var splr=new splitter(this.wnd, document.body);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
*
* @param wnd
* @param parentElement
* @returns
*/

function splitter(wnd, parentElement) {
XComponent.call(this, wnd, parentElement);
this._initTestPage();
}

extendClass(splitter, XComponent, "splitter");

/**
* 销毁方法
*/
splitter.prototype._initTestPage = function() {
var sp = XPanelSplitter.createWithDom(document.getElementById("testdom"));
sp.setFixedPanel(1, 200);
}

/**
* 释放资源
*/
splitter.prototype.dispose = function() {
XComponent.prototype.dispose.call(this);
}

splitter.getInstance = function() {
return new splitter(window, document.getElementById("testdom"));
};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
*
* @param wnd
* @param parentElement
* @returns
*/

function pageCtrl(wnd, parentElement) {
XComponent.call(this, wnd, parentElement);
this._initTestPage();
}

extendClass(pageCtrl, XComponent, "pageCtrl");

/**
* 销毁方法
*/
splitter.prototype._initTestPage = function() {
var sp = XPanelSplitter.createWithDom(document.getElementById("testdom"));
sp.setFixedPanel(1, 200);
}

/**
* 释放资源
*/
splitter.prototype.dispose = function() {
XComponent.prototype.dispose.call(this);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
function Histogrm(wnd, container, bname, count) {
this._wnd = wnd || window;
this._doc = this._wnd.document;
this._container = container;
this._bname = bname;
this._count = count;

this._initUI();
}
/**
* 创建方法 这样就不用new 类似后端getInstance()
*
*/
Histogrm.create = function(wnd, container, bname, count) {
return new Histogrm(wnd, container, bname, count);
}



Histogrm.prototype._initUI = function() {
if (!this._inited) {
//柱状图的柱子部分,不显示出来
this._bigDiv = this._doc.createElement("div");
this._bigDiv.className = "bigDiv";
//柱状图的颜色部分
this._innerDiv = this._doc.createElement("div");
this._innerDiv.className = "innerDiv";
this._innerDiv.style.height = this._count * 10 + "px";
this._innerDiv.style.marginTop = 200 - this._count * 10 + "px";
this._innerDiv.style.backgroundColor = this._colorRandom();
this._bigDiv.appendChild(this._innerDiv);
//显示图书名称
this._font1 = this._doc.createElement("div");
this._font1.className = "fontbookname";
this._font1.innerHTML = this._bname;
//显示统计次数
this._font2 = this._doc.createElement("div");
this._font2.className = "fontbooknumber";
this._font2.innerHTML = "(" + this._count + ")";

this._container.appendChild(this._bigDiv);
this._container.appendChild(this._font1);
this._container.appendChild(this._font2);

this._inited = true;
}
}
//随机生成颜色方法
Histogrm.prototype._colorRandom = function() {
var r = Math.floor(Math.random() * 256);
var g = Math.floor(Math.random() * 256);
var b = Math.floor(Math.random() * 256);
return "rgb(" + r + ',' + g + ',' + b + ")";
};
  • 自己吧上面的修改
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
function bookmain(wnd, parentElement) {
XComponent.call(this, wnd, parentElement);
this._initTestPage();
this.sp;
this.tree;
this.his;
this.pageCtrl;
var list;//列表
}

extendClass(bookmain, XComponent, "bookmain");





/**
* 销毁方法
*/
bookmain.prototype.dispose = function() {
if (this.sp) {
this.sp.dispose();
this.sp = null;
}
if (this.tree) {
this.tree.dispose();
this.tree = null;
}
if (this.his) {
this.his.dispose();
this.his = null;
}
if (this.pageCtrl) {
this.pageCtrl.dispose();
this.pageCtrl = null;
}
if (this.list) {
this.list.dispose();
this.list = null;
}
XComponent.prototype.dispose.call(this);
}

/**
* 初始化方法
*/
bookmain.prototype._initTestPage = function() {
// ----------------------------xsplitter----------------------
this.sp = XPanelSplitter.createWithDom(document.getElementById("testdom"));
this.sp.setFixedPanel(1, 200);

// ----------------------------xtree--------------------------
this.tree = new XTree(window, document.getElementById("left-div"), "100%", "100%");
var root = tree.getRootItem();
var map = new Map();
map.put("action", "main");
QueryObj.create("index.do", map, function(query){
try {
query.checkResult();
var res = query.getResponseJSON();
for(var i = 0; i < res.length; i++){
var a = res[i];
var b = a.split(",");
var item = root.appendChild(b[0]);
item.setHasChildren(true);
item.setUserObj({
id : b[1]
});
}
} catch(e) {
hideWaitDialog();
showError(e);
}
});

//节点展开
this.tree.setOnExpand(function(item){
item.clearChildren();
var params = new Map();
params.put("cid",item.userObj.id);
params.put("action", "tree");
QueryObj.create("index.do", params, function(query){
try {
query.checkResult();
var res = query.getResponseJSON();
for(var i = 0; i < res.length; i++){
//添加子节点
var a = res[i];
var b = a.split(",");
var childitem = item.appendChild(b[0]);
childitem.setUserObj({
id : b[1]
});
}
} catch(e) {
hideWaitDialog();
showError(e);
}
});

});
this._createXtabctrl();
this._createXlist();
//绑定点击事件
tree.setOnClick(function(item, event){
var tid = item.userObj.id;
//alert(tid);
var params = new Map();
params.put("tid",tid);
params.put("action","display");
QueryObj.create("index.do", params, function(query){
try {
query.checkResult();
var res = query.getResponseJSON();
if(document.getElementById("mytable") != null){
var dom1 = document.getElementById("div_count");
var child = document.getElementById("mytable");
dom1.removeChild(child);
//dom1.innerHTML = "";
list.clear();
}
var mytable=document.createElement("table");
mytable.setAttribute("id","mytable");
var row1=mytable.insertRow(-1);
for(var i = 0; i < res.length; i++){
var a = res[i];
var b = a.split(",");
//添加列表
list.addRow(b[0], b[1], b[2], b[3]);
if( i == 0){
var bname = b[0];
var count = b[4];
var cell=row1.insertCell(-1);
var his=new Histogrm(window,cell,bname,count);
}else if(res[i].split(",")[0] != res[i-1].split(",")[0]){
var bname = b[0];
var count = b[4];
var cell = row1.insertCell(-1);
var his = new Histogrm(window,cell,bname,count);
}
}
div_count.appendChild(mytable);

} catch(e) {
hideWaitDialog();
showError(e);
}
});

});
}
/**
* 构建页面选择按钮
*/
bookmain.prototype._createXtabctrl = function() {
//右表显示
this.pageCtrl = new XPageControl(window, document.getElementById("right-div"));
//列表
var div_table = document.createElement("div");
div_table.setAttribute("id","div_table");
this.pageCtrl.addPage(I18N.getString("test.web.study.test.ftl.jyjl","借阅记录"), "").appendChild(div_table);

//图形
var div_count = document.createElement("div");
div_count.setAttribute("id","div_count");
pageCtrl.addPage(I18N.getString("test.web.study.test.ftl.tjfx","统计分析"), "").appendChild(div_count);

pageCtrl.setActive(0);


}
/**
* 构建列表
*
*/

bookmain.prototype._createXlist = function() {
var columns = [["书名", "25%"], ["借阅人", "25%"], ["借阅时间", "25%"], ["归还时间", "25%"]];
list = new XList(window,document.getElementById("div_table"),"100%","100%");
list.enableThreeState(true);
list.setSortable(true);
list.setMouseOver(true);
list.setTextSelected(false);
list.setDraggable(true);
list.setDropable(true);
list.setColorEvenRows(true);
list.setAllTextCell(false);
list.initWithColumns(columns);

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
package com.esen.gxdc.util;



import java.util.ArrayList;
import java.util.List;

import com.esen.gxdc.dao.BikeGPSAllDao;
import com.esen.gxdc.dao.BikeGPSDao;
import com.esen.gxdc.entity.BikeGPS;
import com.esen.gxdc.entity.BikeGPSList;
import com.esen.util.StrFunc;





/**
* 插入数据库的工具类
* @author fangjun
*
*/

public class InsertUtil {
private static InsertUtil instance;
public static synchronized InsertUtil getInstance() {
if (instance == null) {
instance = new InsertUtil();
}
return instance;
}
/**
* 获取bs 设置定时器 定义线程插入数据库
* @param bs
*/
public static void insertBySum(final BikeGPSList bs ){
Thread t1= new Thread(){
public void run(){

while(true){
try {
Thread.sleep(60000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
for(BikeGPS b:bs.getBikeGPSList()){
BikeGPSAllDao.getInstance().add(b);
if (b.getVehicleCurrentStatus() == 0) {
BikeGPSDao.getInstance().add(b);
}
}
}
}
};
t1.start();

}
/**
* 将List<String> 转化为List<BikeGPS>
* @param datas
* @return
*/
public static List<BikeGPS> strList2bgpsList(List<String> datas){
List<BikeGPS> bikeGPSs = new ArrayList<BikeGPS>();
for (String msg : datas) {
String[] fields = msg.split(",");
// 把string类型数据更改格式并存入BikeGPS对象
BikeGPS bGps = new BikeGPS();
bGps.setLatitude(fields[1]);
bGps.setLongitude(fields[2]);
bGps.setTime(fields[3].replace("\"", ""));
bGps.setSpeed(StrFunc.str2float(fields[4], 0.1f));
bGps.setDirection(StrFunc.str2float(fields[5], 0.1f));
bGps.setMileage(StrFunc.str2float(fields[6], 0.1f));
bGps.setVehicleId(fields[7].replace("\"", ""));
bGps.setVehicleType(StrFunc.str2int(fields[8], 1));
bGps.setVehicleNumber(fields[9]);
bGps.setGpsDevicesNumber(fields[10].replace("\"", ""));
bGps.setRawData(fields[11]);
bGps.setStateValue(StrFunc.str2int(fields[12], 1));
bGps.setAlarmValue(StrFunc.str2int(fields[13], 1));
bGps.setCompanyCode(StrFunc.str2int(fields[14], 1));
bGps.setVehicleCurrentStatus(StrFunc.str2int(fields[15].replace("}", ""), 1));
bGps.setArea(String.valueOf((int) (1 + Math.random() * 99999999)));

bikeGPSs.add(bGps);
}
return bikeGPSs;
}
/**
* 获取socket的数据 转化为List<String>datas 每个String一条记录对应一个BikeGPS对象
* 存入List<BikeGPS>bgps 在放入BikeGPSList对象 存入数据库 以上全部在线程中完成
* @param datas
*/
public static void datas2db(final List<String> datas){
Thread t1= new Thread(){
public void run() {

try {
Thread.sleep(60000);
} catch (InterruptedException e) {

e.printStackTrace();
}
// 将一个String多条记录数据转化为一个String一条记录
List<String> msgs = new ArrayList<String>();
for (String data : datas) {
String[] fileds = data.split("}");
for (int i = 0; i < fileds.length; i++) {
msgs.add(fileds[i]);
}

}

BikeGPSList msgList = new BikeGPSList();
msgList.setBikeGPSList(InsertUtil.strList2bgpsList(msgs));

// 得到 对象 插入数据库
for (BikeGPS b : msgList.getBikeGPSList()) {
BikeGPSAllDao.getInstance().add(b);
if (b.getVehicleCurrentStatus() == 0) {
BikeGPSDao.getInstance().add(b);
}
}
}

};
t1.start();
}

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package com.esen.gxdc.test;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;

import org.apache.tools.ant.types.selectors.DateSelector;

import com.esen.gxdc.dao.BikeGPSAllDao;
import com.esen.gxdc.dao.BikeGPSDao;
import com.esen.gxdc.entity.BikeGPS;
import com.esen.gxdc.entity.BikeGPSList;
import com.esen.gxdc.util.InsertUtil;
import com.esen.util.StrFunc;

/**
* 从socket获取数据存入List<String> 在转存到List<BikeGPS> 并用orm插入数据库
*
* @author fangjun
*
*/
public class DataForward {


public static String logincode = "{class:wzg.user.cmd.LoginRequest,0,\"huayu\",\"hy2018\",0,}";

public static void main(String[] args) throws UnknownHostException,
IOException {
Socket s = new Socket("221.232.149.173", 7003);// 建立socket连接

InputStream inputStream = s.getInputStream();
OutputStream outputStream = s.getOutputStream();
byte[] bytes = new byte[1024 * 1024 * 10];
int len;
try {
s.setSoTimeout(3 * 60 * 1000);// 设置3分钟读取超时时间

outputStream.write(logincode.getBytes("UTF-8"));// 发送登录请求
outputStream.write("{class:cmd.RequestData,0,8192,1}"
.getBytes("UTF-8"));// 发送获取数据请求
/*
* 前2次read: 第一次的登录返回的结果({class:wzg.user.cmd.LoginResult,0,0,,});
* 第二次是第二次请求返回的结束(并非数据)({class:wzg.systems.ResultArgs,0,0,})
* 所有要放掉2次read,从第三次开始
*/
for (int i = 0; i < 2; i++) {
inputStream.read(bytes);
// len = inputStream.read(bytes);
// System.out.println(new String(bytes, 0, len, "UTF-8"));
}
int count = 1;
List<String> datas = new ArrayList<String>();
while ((len = inputStream.read(bytes)) != -1) {
// 注意指定编码格式,发送方和接收方一定要统一,使用UTF-8
datas.add(new String(bytes, 0, len, "UTF-8"));
// System.out.println(new String(bytes, 0, len,"UTF-8"));
//每当数据积累到200条后 开启一个线程并延时1分钟对对该数据进行处理
if (count % 200 == 0) {
InsertUtil.datas2db(datas);
datas.clear();
}
count++;

}

/*
* for (int i = 0; i < 100; i++) { len = inputStream.read(bytes);
* datas.add(new String(bytes, 0, len, "UTF-8")); } for(String
* data:datas){ System.out.println(data); }
*/

} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
inputStream.close();
outputStream.close();
s.close();
}

}
}