Java FileInputStream Copy copyFile(String srcDir, String destDir)

Here you can find the source of copyFile(String srcDir, String destDir)

Description

copy File

License

Open Source License

Declaration

public static void copyFile(String srcDir, String destDir)
        throws IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class Main {

    public static void copyFile(String srcDir, String destDir)
            throws IOException {
        FileInputStream in = new FileInputStream(srcDir);
        FileOutputStream out = new FileOutputStream(destDir);
        int ch;/* www .  j ava2  s . com*/
        while ((ch = in.read()) != -1) {
            out.write((byte) ch);
        }

        in.close();
        out.close();
    }
}

Related

  1. copyFile(String src, String dest)
  2. copyFile(String src, String dst)
  3. copyFile(String src, String dst)
  4. copyFile(String src, String tar)
  5. copyFile(String src, String to)
  6. copyFile(String srcFile, String destFile)
  7. copyFile(String srcFile, String dstFile)
  8. copyFile(String srcFile, String dstFile)
  9. copyFile(String srcFileName, String destFileName)