private void file_to_file(File in_file, File out_file) throws IOException, InterruptedException { FileInputStream in = in_file.inputStream(); FileOutputStream out = out_file.outputStream(); byte[] buffer = new byte[BUFFER_SIZE]; int n_read; while ((n_read = in.read(buffer)) != -1) { checkForInterruption(); out.write(buffer, 0, n_read); } in.close(); out.close(); }