Подскажите, пожалуйста, что не нравится валидатору, не могу понять.
Спасибо!
package com.javarush.task.task18.task1813;
import java.io.*;
import java.nio.channels.FileChannel;
//import java.io.FileOutputStream;
/*
AmigoOutputStream
*/
public class AmigoOutputStream extends FileOutputStream{
public static String fileName = "C:/tmp/result.txt";
private FileOutputStream original;
public AmigoOutputStream(FileOutputStream original) throws FileNotFoundException {
super(fileName);
this.original = original;
}
public AmigoOutputStream(String name) throws FileNotFoundException {
super(name);
}
public AmigoOutputStream(String name, boolean append) throws FileNotFoundException {
super(name, append);
}
public AmigoOutputStream(File file) throws FileNotFoundException {
super(file);
}
public AmigoOutputStream(File file, boolean append) throws FileNotFoundException {
super(file, append);
}
public AmigoOutputStream(FileDescriptor fdObj) {
super(fdObj);
}
@Override
public void write(int b) throws IOException {
original.write(b);
}
@Override
public void write(byte[] b) throws IOException {
original.write(b);
}
@Override
public void write(byte[] b, int off, int len) throws IOException {
original.write(b, off, len);
}
@Override
public void close() throws IOException {
original.flush();
String string = "JavaRush © All rights reserved.";
original.write(string.getBytes());
original.close();
}
@Override
public FileChannel getChannel() {
return super.getChannel();
}
@Override
protected void finalize() throws IOException {
super.finalize();
}
@Override
public void flush() throws IOException {
original.flush();
}
public static void main(String[] args) throws FileNotFoundException {
new AmigoOutputStream(new FileOutputStream(fileName));
}
}