Что не так в решении?
package com.javarush.task.task18.task1817;
/*
Пробелы
*/
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
public class Solution {
public static void main(String[] args) throws FileNotFoundException, IOException {
FileInputStream inputStream = new FileInputStream(args[0]);
int totalChar = 0;
double space=0;
while (inputStream.available()>0){
int data = inputStream.read();
totalChar++;
if(data==Integer.valueOf(" ")) space++;
}
inputStream.close();
double result = space/totalChar*100;
System.out.println(new BigDecimal(result).setScale(2, RoundingMode.HALF_UP).floatValue());
}
}