我想从服务器向客户端发送非常大的数据,服务器是 tomcat Java,客户端是 android 应用程序,我正在使用 servlet
服务器小服务程序
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException,
IOException {
ServletOutputStream out = response.getOutputStream();
CellDatabase cDB = new CellDatabase();
String[] cells = cDB.getAllCells();
for (int i = 0; i < cells.length; i++)
out.write(cells[i].getBytes());
out.flush();
}
我的问题是:我怎样才能在 android 上获得这些数据,因为我没有找到类似的东西
response.getOutputStream();
安卓
HttpClient client = new DefaultHttpClient();
website = new URI(
"http://10.0.2.2:8080/LocalizedBasedComptitionServer/GetCells");
HttpPost request = new HttpPost();
request.setURI(website);
HttpResponse response = client.execute(request);