Here you can find the source of copy(String input, String output)
Parameter | Description |
---|---|
String | output file |
public static boolean copy(String input, String output) throws Exception
//package com.java2s; import java.io.*; public class Main { /**// w w w .j a va2 s .c om * This class copies an input file to output file * * @param String input file to copy from * @param String output file */ public static boolean copy(String input, String output) throws Exception { int BUFSIZE = 65536; FileInputStream fis = new FileInputStream(input); FileOutputStream fos = new FileOutputStream(output); try { int s; byte[] buf = new byte[BUFSIZE]; while ((s = fis.read(buf)) > -1) { fos.write(buf, 0, s); } } catch (Exception ex) { throw new Exception("makehome" + ex.getMessage()); } finally { fis.close(); fos.close(); } return true; } }