您的位置:首页 > 编程语言 > Java开发

java_IO读写模版

2013-12-06 23:57 351 查看
InputStream in = null;
OutputStream out = null;

try{
in = new FileInputStream();
int len=0;
byte buffer[] = new byte[1024];
out = new FileOutputStream();
while((len=in.read(buffer))>0){
out.write(buffer,0,len);
}
}finally{
if(in!=null){
try{
in.close();
}catch(Exception e){
e.printStackTrace();
}

}
if(out!=null){
try{
out.close();
}catch(Exception e){
e.printStackTrace();
}

}
}


 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  java