Пишет, что метод close() должен спрашивать, так он у меня вроде спрашивает
package com.javarush.task.task18.task1812;
import java.io.*;
/*
Расширяем AmigoOutputStream
*/
public class QuestionFileOutputStream implements AmigoOutputStream {
private AmigoOutputStream orig;
public QuestionFileOutputStream(AmigoOutputStream orig){
this.orig = orig;
}
public void flush() throws IOException{
orig.flush();
}
public void write(int b) throws IOException{
orig.write(b);
}
public void write(byte[] b) throws IOException{
orig.write(b);
}
public void write(byte[] b, int off, int len) throws IOException{
orig.write(b, off, len);
}
public void close() throws IOException{
System.out.println("Вы действительно хотите закрыть поток? Д/Н");
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
FileInputStream filestream = new FileInputStream(reader.readLine());
if(reader.readLine().equals("Д")){
filestream.close();
}
reader.close();
}
public static void main(String[] args){
}
}