подскажите пожалуйста где закрывать потоки, Unreachable statement почему-то
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
String firstName=reader.readLine();
String secondName=reader.readLine();
String thirdName=reader.readLine();
FileInputStream fis1=new FileInputStream(firstName);
FileOutputStream fos1=new FileOutputStream(secondName);
FileOutputStream fos2=new FileOutputStream(thirdName);
byte [] firstArray=new byte[firstName.length()];
int aByte=fis1.read(firstArray);
while (true) {
if(fis1.available() /2 !=0) {
fos1.write(firstArray,0,firstName.length()/2+1);
fos2.write(firstArray, firstName.length()/2-1, firstName.length()-firstName.length()/2-1);
}
else {
fos1.write(firstArray,0,firstName.length()/2);
fos2.write(firstArray, firstName.length()/2, firstName.length()/2);
}
}
fis1.close(); // так нельзя
fos1.close();
fos2.close();
}
}