public class StackWriter extends Writer
| Modifier and Type | Field and Description |
|---|---|
protected Writer |
output
Текущий writer
|
protected Stack<Writer> |
stack
Стек памяти writer-ов
|
| Constructor and Description |
|---|
StackWriter(Writer output)
Конструктор
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Вызывает flush(), а затем в обратной последовательности close() для стека writer-ов.
|
void |
flush()
Скидывает содежимое всего стека в основной writer, в той же последовательности что и соот. вызовы write(...)
|
Stack<Writer> |
getStack()
Указывает стек памяти writer-ов
|
String |
pop()
Извлекает из текущего writer-а что было напечатано, восстанавливает из стека текущий writer.
|
void |
push()
Сохраняет в стеке текущий writer.
|
void |
write(char[] cbuf,
int off,
int len) |
protected Writer output
public StackWriter(Writer output)
output - куда производить выводpublic Stack<Writer> getStack()
public void push()
public String pop()
public void write(char[] cbuf,
int off,
int len)
throws IOException
write in class WriterIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class WriterIOException - Ошибка IOpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class WriterIOException - Ошибка IOCopyright © 2018. All rights reserved.