Everything works fine as it should, and the outcome is correct so why the 4th task does not count ?
package pl.codegym.task.task18.task1808;
import java.io.*;
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String one = reader.readLine();
String two = reader.readLine();
String three = reader.readLine();
FileInputStream fileOne = new FileInputStream(one);
FileOutputStream fileTwo = new FileOutputStream(two);
FileOutputStream fileThree = new FileOutputStream(three);
byte[] bytes = new byte[1000];
byte[] b = new byte[fileOne.available()];
if(b.length % 2 == 0) {
while (fileOne.available() > 0) {
int d = fileOne.read(bytes);
fileTwo.write(bytes, 0, d / 2);
fileThree.write(bytes, d / 2, d);
}
} else{
while (fileOne.available() > 0) {
int d = fileOne.read(bytes);
fileTwo.write(bytes, 0, d / 2 + 1);
fileThree.write(bytes, d / 2 + 1, d);
}
}
fileOne.close();
fileTwo.close();
fileThree.close();
}
}
/*
Odczytaj 3 nazwy plików z konsoli: file1, file2, file3.
Podziel file1 w następujący sposób:
Zapisz pierwszą połowę jego bajtów do file2, a drugą połowę do file3.
Jeśli liczba bajtów w file1 jest nieparzysta, to file2 powinien zawierać więcej bajtów.
Zamknij strumienie.
*/