Добрый день! Подскажите пожалуйста, при отправке задачи на валидацию, валидатор выдает Time out 12 20. С чем это может быть связано?
Спасибо!
package com.javarush.task.task18.task1813;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
/*
AmigoOutputStream
*/
public class AmigoOutputStream extends FileOutputStream {
public static String fileName = "C:/tmp/result.txt";
private FileOutputStream fileOutputStream;
public AmigoOutputStream(FileOutputStream fileOutputStream) throws FileNotFoundException {
super(fileName);
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 write(byte b[]) throws IOException {
fileOutputStream.write(b);
}
@Override
public void write(byte b[], int off, int len) throws IOException {
fileOutputStream.write(b, off, len);
}
@Override
public void flush() throws IOException {
fileOutputStream.flush();
}
@Override
public void close() throws IOException {
this.flush();
String s = "JavaRush © All rights reserved.";
fileOutputStream.write(s.getBytes(StandardCharsets.UTF_8));
this.close();
}
}