JSONObject jsonObject = JSONObject.fromObject(valueObject);
fileBytes = serviceUtil.exportData2File(jsonObject.getJSONArray("datalist"), jsonObject.getInt("size"));
System.out.println("===============导出业务数据完成============");
}
/********************************处置文件完毕********************************/
if(fileBytes==null){
dos.writeUTF("error");
dos.flush();
dos.writeUTF("处置文件进程中错误");
dos.flush();
process=false;
}
/********************************前往处置过的文件********************************/
if(process){
dos.writeUTF("info");//文件处置完成,将信息前往到客户端
dos.flush();
int fileBytelength = fileBytes.length;//转换后的文件长度
System.out.println(format.format(new Date())+":======== 效劳端末尾发送文件流,文件大小("+getFormatFileSize(fileBytelength)+") ========");
dos.writeLong(fileBytelength);
dos.flush();
dos.write(fileBytes, 0, fileBytelength);//将文件一同写入到输入流发送
dos.flush();
System.out.println(format.format(new Date())+":======== 发送文件流成功 ========");
}
(责任编辑:admin)