首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

以源的方式输出文件

2013-11-14 
以流的方式输出文件??? OutputStream o socket.getOutputStream()File filenew File(/opt/froad/conf

以流的方式输出文件

??? OutputStream o = socket.getOutputStream();

File file=new File("/opt/froad/config/mgmt/file/20131105.zip");
??? ??? ??? ??? ??? ??? DataInputStream fis=new DataInputStream(new BufferedInputStream(new FileInputStream(file)));
??? ??? ??? ??? ??? ??? byte[] b =new byte[fis.available()];
??? ??? ??? ??? ??? ??? fis.read(b);
??? ??? ??? ??? ??? ??? o.write(b);
??? ??? ??? ??? ??? ??? o.flush();
??? ??? ??? ??? ??? ??? o.close();

热点排行