Package org.codehaus.commons.compiler.io
Class Readers
- java.lang.Object
-
- org.codehaus.commons.compiler.io.Readers
-
-
Field Summary
Fields Modifier and Type Field Description static Reader
EMPTY_READER
Any attempts to read return an "end-of-input" condition.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Reader
concat(Reader... delegates)
static Reader
concat(Iterable<Reader> delegates)
static void
copy(Reader in, Writer out)
static Reader
onFirstChar(Reader in, Runnable runnable)
static String
readAll(Reader in)
static Reader
teeReader(Reader in, Writer out, boolean closeWriterOnEoi)
static Reader
trackLineAndColumn(Reader in, LineAndColumnTracker tracker)
-
-
-
Field Detail
-
EMPTY_READER
public static final Reader EMPTY_READER
Any attempts to read return an "end-of-input" condition.
-
-
Method Detail
-
onFirstChar
public static Reader onFirstChar(Reader in, Runnable runnable)
- Returns:
FilterReader
that runs the runnable right before the first character is read
-
trackLineAndColumn
public static Reader trackLineAndColumn(Reader in, LineAndColumnTracker tracker)
- Returns:
- A
FilterReader
that tracks line and column numbers while characters are being read
-
concat
public static Reader concat(Iterable<Reader> delegates)
- Returns:
- Reads from the first element of the delegates, then, after EOI, from the second until EOI, and so forth
-
readAll
public static String readAll(Reader in) throws IOException
- Throws:
IOException
-
copy
public static void copy(Reader in, Writer out) throws IOException
- Throws:
IOException
-
-