Привет!
Ошибки в 28 и 29 строках.
Но я не понимаю как их исправить.
Подскажите, как можно их поправить
package com.javarush.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 donorFile = reader.readLine();
String fileWithFirstPart = reader.readLine();
String fileWithSecondPart = reader.readLine();
FileInputStream donorFis = new FileInputStream(donorFile);
FileOutputStream fileWithFirstPartFos = new FileOutputStream(fileWithFirstPart);
FileOutputStream fileWithSecondPartFos = new FileOutputStream(fileWithSecondPart);
byte[] buffer = new byte[1000];
while (donorFis.available() > 0){
int count = donorFis.read(buffer);
if(donorFis.available()%2==0){
fileWithFirstPartFos.write(buffer,0,count/2);
fileWithSecondPartFos.write(buffer,count/2,count);
} else {
fileWithFirstPartFos.write(buffer,0,(count/2)+1);
fileWithSecondPartFos.write(buffer,(count/2)+1,count);
}
}
reader.close();
donorFis.close();
fileWithFirstPartFos.close();
fileWithSecondPartFos.close();
}
}