Вроде все правильно и работает но валидатор не пропускает.
package com.javarush.task.task18.task1808;
/*
Разделение файла
*/
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
System.out.println("Give me the name of file");
FileOutputStream outputStream = new FileOutputStream(sc.nextLine());
System.out.println("Give me the name of file");
FileOutputStream outputStream1 = new FileOutputStream(sc.nextLine());
FileInputStream inputStream1 = new FileInputStream(sc.nextLine());
byte[] buffer = new byte[inputStream1.available()];
if (inputStream1.available() % 2 != 0) {
int count = inputStream1.read(buffer);
outputStream.write(buffer, 0, (count / 2) + 1);
outputStream1.write(buffer, (count + 1) / 2, count / 2);
}else{
int count = inputStream1.read(buffer);
outputStream.write(buffer, 0, (count / 2) );
outputStream1.write(buffer, count / 2, count / 2);
}
inputStream1.close();
outputStream.close();
outputStream1.close();
}
}