public static void copy(File src,File dst) throws IOException {
  FileInputStream inStream=new FileInputStream(src);
  FileOutputStream outStream=new FileOutputStream(dst);
  FileChannel inChannel=inStream.getChannel();
  FileChannel outChannel=outStream.getChannel();
  inChannel.transferTo(0,inChannel.size(),outChannel);
  inStream.close();
  outStream.close();
}

public static void copy ( File src , File dst ) throws IOException { FileInputStream inStream = new FileInputStream ( src ) ; FileOutputStream outStream = new FileOutputStream ( dst ) ; FileChannel inChannel = inStream . getChannel ( ) ; FileChannel outChannel = outStream . getChannel ( ) ; inChannel . transferTo ( 0 , inChannel . size ( ) , outChannel ) ; inStream . close ( ) ; outStream . close ( ) ; }
copy file ( only use for files smaller than 2gb )
