В общем, по старой доброй традиции, сначала решил благодаря комментариям задачу, а потом уже начал ее проверять.
Так вот при тестировании методов. например write. надпись в консоль выводится, а в файл не записывается.
Может я некорректно в main создаю экземпляр класса?
public class FileConsoleWriter {
private FileWriter fileWriter;
public FileConsoleWriter(String fileName, int i, int i1) throws IOException {
fileWriter = new FileWriter(fileName);
}
public FileConsoleWriter(String fileName, boolean append) throws IOException {
fileWriter = new FileWriter(fileName, append);
}
public FileConsoleWriter(File file) throws IOException {
fileWriter = new FileWriter(file);
}
public FileConsoleWriter(File file, boolean append) throws IOException {
fileWriter = new FileWriter(file, append);
}
public FileConsoleWriter(FileDescriptor fd) {
fileWriter = new FileWriter(fd);
}
public void close() throws IOException {
fileWriter.close();
}
public void write(char[] cbuf, int off, int len) throws IOException {
this.fileWriter.write(cbuf,off,len);
System.out.println(new String(cbuf).substring(off,off+len));
}
public void write(char[] cbuf) throws IOException {
this.fileWriter.write(cbuf);
System.out.println(new String(cbuf));
}
public void write(int c) throws IOException {
this.fileWriter.write(c);
System.out.println((char)c);
}
public void write(String str) throws IOException {
this.fileWriter.write(str);
System.out.println(str);
}
public void write(String str, int off, int len) throws IOException {
this.fileWriter.write(str,off, len);
System.out.println(new String(str).substring(off,off+len));
}
public Writer append(CharSequence csq) throws IOException {
return this.fileWriter.append(csq);
}
public Writer append(CharSequence csq, int start, int end) throws IOException {
return this.fileWriter.append(csq, start, end);
}
public Writer append(char c) throws IOException {
return this.fileWriter.append(c);
}
public static void main(String[] args) throws IOException {
FileConsoleWriter fileConsoleWriter = new FileConsoleWriter(new File("C:\\Users\\user\\Desktop\\File\\file.txt"));
fileConsoleWriter.write("oleg i kira");
}
}