condition 4 not satisfying
package com.codegym.task.task18.task1808;
import java.io.*;
/*
Splitting a file
*/
public class Solution {
public static void main(String[] args) throws Exception{
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String file1 = bf.readLine();
String file2 = bf.readLine();
String file3 = bf.readLine();
FileInputStream fp = new FileInputStream(file1);
FileOutputStream fw1 = new FileOutputStream(file2);
FileOutputStream fw2 = new FileOutputStream(file3);
byte[] buffer = new byte[1000];
if(fp.available() > 0){
int count = fp.read(buffer);
if(count % 2 == 0) {
fw1.write(buffer, 0, (count/2));
fw2.write(buffer,(count/2),count);
}else {
fw1.write(buffer,0,(count/2)+1);
fw2.write(buffer,(count/2)+1,count);
}
}
fp.close();
fw1.close();
fw2.close();
}
}