Почему-то пишет, чтобы учел, чтомогут быть числа типа int в файле1
package com.javarush.task.task18.task1820;
/*
Округление чисел
*/
import java.io.*;
import java.util.ArrayList;
public class Solution {
public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
FileInputStream fis = null;
FileOutputStream fos = null;
try {
String fName1 = br.readLine();
String fName2 = br.readLine();
fis = new FileInputStream(fName1);
fos = new FileOutputStream(fName2);
int count = fis.available();
byte[] buf = new byte[count];
fis.read(buf, 0, count);
String s = "";
for (int i = 0; i < count; i++){
s += i;
}
//ArrayList<Double> dArr = new ArrayList<>();
long n;
for (String str: s.split(" ")) {
//dArr.add(Double.parseDouble(str));
n = Math.round(Double.parseDouble(str));
fos.write((int) n);
fos.write(Integer.parseInt(" "));
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
fis.close();
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}