Like in last example we using java core library FileOutputStream
here example
FileInputStream fileInputStream=null;
File myFile = new File("C:\\myFile.txt");
byte[] byteFile = new byte[(int) myFile.length()];
try {
fileInputStream = new FileInputStream(myFile);
fileInputStream.read(byteFile);
fileInputStream.close();
FileOutputStream fileOuputStream = new FileOutputStream("C:\\toFile.txt");
fileOuputStream.write(bFile);
fileOuputStream.close();
}catch(Exception ex){
ex.printStackTrace();
}