public class TransformingFilterWriter extends Writer
Writer which transforms the character stream on-the-fly with a Transformer<String>.
When the returned writer is flushed or closed, then the transformer is invoked with an empty char sequence, which tells it to "flush itself". This is relevant for stateful transformers.
| Constructor and Description |
|---|
TransformingFilterWriter(TransformerWhichThrows<? super CharSequence,? extends CharSequence,? extends IOException> transformer,
Appendable delegate) |
| Modifier and Type | Method and Description |
|---|---|
Writer |
append(CharSequence csq) |
Writer |
append(CharSequence csq,
int start,
int end) |
void |
close() |
static Writer |
create(TransformerWhichThrows<? super CharSequence,? extends CharSequence,? extends IOException> transformer,
Appendable delegate)
This method is sometimes more efficient than calling "
new TransformingFilterWriter()". |
void |
flush() |
void |
write(char[] cbuf,
int off,
int len) |
void |
write(String str,
int off,
int len) |
public TransformingFilterWriter(TransformerWhichThrows<? super CharSequence,? extends CharSequence,? extends IOException> transformer, Appendable delegate)
public static Writer create(TransformerWhichThrows<? super CharSequence,? extends CharSequence,? extends IOException> transformer, Appendable delegate)
new TransformingFilterWriter()".public void write(char[] cbuf,
int off,
int len)
throws IOException
write in class WriterIOExceptionpublic void write(String str, int off, int len) throws IOException
write in class WriterIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class WriterIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class WriterIOExceptionpublic Writer append(CharSequence csq) throws IOException
append in interface Appendableappend in class WriterIOExceptionpublic Writer append(CharSequence csq, int start, int end) throws IOException
append in interface Appendableappend in class WriterIOExceptionCopyright © 2018 Arno Unkrig. All rights reserved.