Package org.codehaus.commons.compiler.io
Class Readers
- java.lang.Object
-
- org.codehaus.commons.compiler.io.Readers
-
public final class Readers extends java.lang.ObjectUtiltity methods related toReader.
-
-
Field Summary
Fields Modifier and Type Field Description static java.io.ReaderEMPTY_READERAny attempts to read return an "end-of-input" condition.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.io.Readerconcat(java.io.Reader... delegates)static java.io.Readerconcat(java.lang.Iterable<java.io.Reader> delegates)static voidcopy(java.io.Reader in, java.io.Writer out)static java.io.ReaderonFirstChar(java.io.Reader in, java.lang.Runnable runnable)static java.lang.StringreadAll(java.io.Reader in)static java.io.ReaderteeReader(java.io.Reader in, java.io.Writer out, boolean closeWriterOnEoi)static java.io.ReadertrackLineAndColumn(java.io.Reader in, LineAndColumnTracker tracker)
-
-
-
Method Detail
-
onFirstChar
public static java.io.Reader onFirstChar(java.io.Reader in, java.lang.Runnable runnable)- Returns:
FilterReaderthat runs the runnable right before the first character is read
-
trackLineAndColumn
public static java.io.Reader trackLineAndColumn(java.io.Reader in, LineAndColumnTracker tracker)- Returns:
- A
FilterReaderthat tracks line and column numbers while characters are being read
-
concat
public static java.io.Reader concat(java.io.Reader... delegates)
-
concat
public static java.io.Reader concat(java.lang.Iterable<java.io.Reader> delegates)
- Returns:
- Reads from the first element of the delegates, then, after EOI, from the second until EOI, and so forth
-
teeReader
public static java.io.Reader teeReader(java.io.Reader in, java.io.Writer out, boolean closeWriterOnEoi)- Returns:
- A
Readerthat copies the bytes being passed through to a givenWriter; this is in analogy with the UNIX "tee" command
-
readAll
public static java.lang.String readAll(java.io.Reader in) throws java.io.IOException- Throws:
java.io.IOException
-
copy
public static void copy(java.io.Reader in, java.io.Writer out) throws java.io.IOException- Throws:
java.io.IOException
-
-