Ругается на третий поток, поскольку я совсем зеленый в программирование, вероятно я просто чего-то не понимаю. Подскажите пожалуйста
package com.javarush.task.task18.task1818;
import java.io.*;
/*
Два в одном
*/
public class Solution {
public static void main(String[] args) throws IOException {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))){
try (FileOutputStream fileOutputStream = new FileOutputStream(reader.readLine(), true)){
try (FileInputStream firstFileInputStream = new FileInputStream(reader.readLine())){
byte[] firstBuff = new byte[firstFileInputStream.available()];
int firstCount = firstFileInputStream.read(firstBuff);
fileOutputStream.write(firstBuff, 0, firstCount);
}
try (FileInputStream secondFileInputStream = new FileInputStream(reader.readLine())){
byte[] secondBuff = new byte[secondFileInputStream.available()];
int secondCount = secondFileInputStream.read(secondBuff);
fileOutputStream.write(secondBuff, 0, secondCount);
}
}
}
}
}