ничего не записывает в файл в чем ошибка
package com.javarush.task.task18.task1813;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.ref.Cleaner;
/*
AmigoOutputStream
*/
public class AmigoOutputStream extends FileOutputStream{
public static String fileName = "C:/tmp/result.txt";
private FileOutputStream outputStream;
public AmigoOutputStream(FileOutputStream outputStream) throws FileNotFoundException {
super("name", true);
this.outputStream = outputStream;
}
public static void main(String[] args) throws FileNotFoundException {
new AmigoOutputStream(new FileOutputStream(fileName));
}
@Override
public void write(byte[] b) throws IOException {
outputStream.write(b);
}
@Override
public void close() throws IOException {
flush();
String s = "JavaRush © All rights reserved.";
byte[] buf = s.getBytes();
write(buf);
outputStream.close();
}
@Override
public void flush() throws IOException {
outputStream.flush();
}
@Override
public void write(int b) throws IOException {
outputStream.write(b);
}
}