public class TransformingFilterReader extends FilterReader
FilterReader which transforms the character stream on-the-fly with a Transformer<? super CharSequence, ? super CharSequence>.
When the delegate reader is at end-of-input, then the transformer is invoked with an empty char sequence, which tells it to "flush itself". This is relevant for stateful transformers.
in| Constructor and Description |
|---|
TransformingFilterReader(Reader delegate,
TransformerWhichThrows<? super CharSequence,? extends CharSequence,? extends IOException> transformer) |
| Modifier and Type | Method and Description |
|---|---|
static Reader |
create(Reader delegate,
TransformerWhichThrows<? super CharSequence,? extends CharSequence,? extends IOException> transformer)
This method is sometimes more efficient than calling "
new TransformingFilterReader()". |
void |
mark(int readAheadLimit) |
boolean |
markSupported() |
int |
read() |
int |
read(char[] cbuf,
int off,
int len) |
boolean |
ready() |
void |
reset() |
long |
skip(long n) |
closepublic TransformingFilterReader(Reader delegate, TransformerWhichThrows<? super CharSequence,? extends CharSequence,? extends IOException> transformer)
public static Reader create(Reader delegate, TransformerWhichThrows<? super CharSequence,? extends CharSequence,? extends IOException> transformer)
new TransformingFilterReader()".public int read()
throws IOException
read in class FilterReaderIOExceptionpublic int read(@Nullable
char[] cbuf,
int off,
int len)
throws IOException
read in class FilterReaderIOExceptionpublic long skip(long n)
throws IOException
skip in class FilterReaderIOExceptionpublic boolean ready()
ready in class FilterReaderpublic boolean markSupported()
markSupported in class FilterReaderpublic void mark(int readAheadLimit)
throws IOException
mark in class FilterReaderIOExceptionpublic void reset()
throws IOException
reset in class FilterReaderIOExceptionCopyright © 2018 Arno Unkrig. All rights reserved.