develog

java file copy test 본문

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();

}

'Dev > Java' 카테고리의 다른 글

quartz  (0) 2013.09.05
Apache Derby 설치  (0) 2013.08.24
[Maven] pom.xml  (0) 2013.08.13
[java] spring, mybatis config  (0) 2013.08.13
Java EE Documentation  (0) 2013.07.25
Comments