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 Writer
IOException
public void write(String str, int off, int len) throws IOException
write
in class Writer
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class Writer
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class Writer
IOException
public Writer append(CharSequence csq) throws IOException
append
in interface Appendable
append
in class Writer
IOException
public Writer append(CharSequence csq, int start, int end) throws IOException
append
in interface Appendable
append
in class Writer
IOException
Copyright © 2018 Arno Unkrig. All rights reserved.