http://blog.youkuaiyun.com/ta8210/article/details/2073817
int length = 2097152;
FileInputStream in = null;
FileOutputStream out = null;
try{
in = new FileInputStream(JobOperationTest.class.getResource(“”).getFile());
out = new FileOutputStream("");
byte[] buffer = new byte[length];
int num =0;
while((num=in.read(buffer))!=-1){
out.write(buffer,0,num);
}
} finally {
try {
if(in!=null)
in.close();
if(out!=null)
out.close();
} catch (Exception ex) {
}
}
}