The snippet below reads a file using FileInputStream, and writes the file to the given path using FileOutputStream.

Java Code:
byte[] fileBArray = new byte[(int)file.length()];
FileInputStream fis = new FileInputStream(file);
fis.read(fileBArray);

FileOutputStream fos = new FileOutputStream("C:\\abc.jpg");
fos.write(fileBArray);