private String copyFile(File src, File dst) {
if(!dst.getParentFile().exists()){
dst.getParentFile().mkdir();
}
dst = getFileWithSuffixTimeStamp(dst); //METHOD call : append time stamp in file
try{
InputStream inst = new FileInputStream(src);
OutputStream outst = new FileOutputStream(dst);
byte[] buf = new byte[1024];
int len;
while ((len = inst.read(buf)) > 0) {
outst.write(buf, 0, len);
}
inst.close();
outst.close();
}catch(IOException ie){
throw ie;
}
return dst.getAbsolutePath();
}
COPY FILE
最新推荐文章于 2009-08-12 16:46:00 发布