Znalazłem takie rozwiązanie. Na IntelliJ działa wszystko jak należy - sprawdziłem na ćwiczebnych plikach z własnego komputera. Problem pojawia się z weryfikacją - wyświetla się komunikat, że nie może się skompilować: "Error in pl/codegym/task/task18/task1825/Solution.java on line 25 cannot find symbol symbol: method readAllBytes() location: variable bufferedInputStream of type java.io.BufferedInputStream".
Jakieś pomysły co to może oznaczać i jak w praktyce można to rozwiązać?
package pl.codegym.task.task18.task1825;
import java.io.*;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Set;
import java.util.TreeSet;
/*
Tworzenie pliku
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String key;
String path;
while (true){
key = reader.readLine();
if (key.equals("end")) break;
BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream(key));
String[] temp = key.split("part");
path = temp[0] + "txt";
BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(path, true));
byte [] odczyt = bufferedInputStream.readAllBytes();
bufferedOutputStream.write(odczyt);
bufferedInputStream.close();
bufferedOutputStream.close();
}
reader.close();
}
}