can't verify the 3rd and 4th requirement
package com.codegym.task.task18.task1819;
import java.io.*;
import java.util.*;
/*
Combining files
*/
public class Solution {
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
File f1 = new File(br.readLine());
File f2 = new File(br.readLine());
FileInputStream fis1 = new FileInputStream(f1);
byte[] b1 = new byte[fis1.available()];
int count = fis1.read();
FileOutputStream fos = new FileOutputStream(f1);
FileInputStream fis2 = new FileInputStream(f2);
byte[] b = new byte[fis2.available()];
int count1 = fis2.read();
fos.write(count1);
fos.write(b1);
fis1.close();
fis2.close();
fos.close();
}
}