/**
* This class copies an input file to output file
*
* @param String input file to copy from
* @param String output file
*/
public static boolean copy(String input, String output) throws Exception {
int BUFSIZE = 65536;
FileInputStream fis = new FileInputStream(input);
FileOutputStream fos = new FileOutputStream(output);
try {
int s;
byte[] buf = new byte[BUFSIZE];
while ((s = fis.read(buf)) > -1 ){
fos.write(buf, 0, s);
}
}
catch (Exception ex) {
throw new Exception("Can not copy " + input + " to " + output + ex.getMessage());
}
finally {
fis.close();
fos.close();
}
return true;
}
* This class copies an input file to output file
*
* @param String input file to copy from
* @param String output file
*/
public static boolean copy(String input, String output) throws Exception {
int BUFSIZE = 65536;
FileInputStream fis = new FileInputStream(input);
FileOutputStream fos = new FileOutputStream(output);
try {
int s;
byte[] buf = new byte[BUFSIZE];
while ((s = fis.read(buf)) > -1 ){
fos.write(buf, 0, s);
}
}
catch (Exception ex) {
throw new Exception("Can not copy " + input + " to " + output + ex.getMessage());
}
finally {
fis.close();
fos.close();
}
return true;
}
解决方案 »
- axis2.1
- 紧急求救,axis调用xfire复杂类型
- FCKeditor上传图片出现jsp
- 关于ajax操作session??
- JSTL 设置语言
- Eclipse问题急!!!大家来帮我看看!!
- 万分火急~~~~毕业设计(题库管理系统)java.lang.NoClassDefFoundError: org/hibernate/Session错误求问
- 在WEB程序中,如何做到访问IP的限制
- 数据内容写入数据库后,如何原样取出来?
- 各位大侠!!请帮帮忙!!! 怎样才能把一个word文档中的内容显示的网页 的页面上???(100分)
- 请问tomcat连接sql server是不是这样连?谢谢!
- OOD是什么意思?
用字符流会怎样呢