pomocy
package pl.codegym.task.task18.task1813;
import java.io.*;
/*
AmigoOutputStream
*/
public class AmigoOutputStream extends FileOutputStream {
public static String fileName = "C:/tmp/result.txt";
public static void main(String[] args) throws FileNotFoundException {
new AmigoOutputStream(new FileOutputStream(fileName));
}
public FileOutputStream orginal;
public AmigoOutputStream (FileOutputStream fileOutputStream) throws FileNotFoundException {
super(String.valueOf((fileOutputStream)));
this.orginal = fileOutputStream;
}
public void write(int mess) throws IOException {
orginal.write(Integer.parseInt(String.valueOf(mess)));
}
public void flush() throws IOException {
orginal.flush();
}
public void close () throws IOException {
orginal.flush();
orginal.write(Integer.parseInt("CodeGym © All rights reserved."));
orginal.close();
}
}