标签:写文件 write ons content fileinput stream pos tac 读取
//设置Content-Disposition
response.setHeader("Content-Disposition", "attachment;filename="+docName);
//读取文件
InputStream in = new FileInputStream(fullFileName);
OutputStream outs = response.getOutputStream();
//写文件
int b;
while((b=in.read())!= -1)
{
outs.write(b);
}
in.close();
outs.close();
标签:写文件 write ons content fileinput stream pos tac 读取
原文地址:http://www.cnblogs.com/fg-fd/p/7026266.html