Dev/Java
java file copy test
냐옴
2013. 8. 21. 12:48
public static void copyTest() throws Exception {
FileInputStream fis = new FileInputStream("aa.zip");
FileOutputStream fos = new FileOutputStream("bb.zip");
int bytesRead;
byte[] buffer = new byte[1024 * 2];
while ((bytesRead = fis.read(buffer, 0, buffer.length)) > -1) {
fos.write(buffer, 0, bytesRead);
}
fis.close();
fos.close();
}