22 lines
597 B
Java
22 lines
597 B
Java
package com.tenwa.app.invoice.utils;
|
|
|
|
import java.io.File;
|
|
import java.io.FileInputStream;
|
|
import java.io.FileOutputStream;
|
|
import java.io.IOException;
|
|
|
|
public class FileCopy {
|
|
public static void copyFile(File fromFile,File toFile) throws IOException{
|
|
FileInputStream ins = new FileInputStream(fromFile);
|
|
FileOutputStream out = new FileOutputStream(toFile);
|
|
byte[] b = new byte[1024];
|
|
int n=0;
|
|
while((n=ins.read(b))!=-1){
|
|
out.write(b, 0, n);
|
|
}
|
|
|
|
ins.close();
|
|
out.close();
|
|
}
|
|
}
|