Hello,
Hello Someone can help me to resolve 4 and 5th step
Thanks a lot
package fr.codegym.task.task18.task1813;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
/*
AmigoOutputStream
*/
public class AmigoOutputStream extends FileOutputStream {
public static String fileName = "C:/tmp/result.txt";
private FileOutputStream fileOutputStream;
public AmigoOutputStream(FileOutputStream fileOutputStream) throws FileNotFoundException {
super(String.valueOf(fileOutputStream));
this.fileOutputStream = fileOutputStream;
}
public static void main(String[] args) throws FileNotFoundException {
new AmigoOutputStream(new FileOutputStream(fileName));
}
@Override
public void write(int b) throws IOException {
fileOutputStream.write(b);
}
@Override
public void flush() throws IOException {
fileOutputStream.flush();
}
@Override
public void close() throws IOException {
flush();
write(124);
fileOutputStream.close();
}
}