В чем ошибка?package com.javarush.task.task19.task1915;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
Дублируем текст
*/
public class Solution {
public static TestString testString = new TestString();
public static void main(String[] args) {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String file = readerReadLine();
PrintStream consoleStream = System.out;
FileOutputStream outputStream1 = new FileOutputStream();
ByteArrayOutputStream outputStream2 = new ByteArrayOutputStream(file);
PrintStream stream = new PrintStream(outputStream2);
System.setOut(stream);
String result = outputStream2.toString();
System.setOut(consoleStream);
TestString.printSomething();
System.out.println("it's a text for testing");
outputStream1.write("it's a text for testing");
BufferedReader.close();
FileOutputStream.close();
}
public static class TestString {
public void printSomething() {
System.out.println("it's a text for testing");
}
}
}