Package org.codehaus.commons.compiler.io

# Class Readers

java.lang.Object
org.codehaus.commons.compiler.io.Readers

public final class Readers extends Object
Utiltity methods related to `Reader`.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final Reader`
`EMPTY_READER`
Any attempts to read return an "end-of-input" condition.

## Method Summary

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)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### EMPTY_READER

public static final Reader EMPTY_READER
Any attempts to read return an "end-of-input" condition.

## Method Details

### 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(Reader... delegates)

### 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

### teeReader

public static Reader teeReader(Reader in, Writer out, boolean closeWriterOnEoi)

Returns:
  A `Reader` that copies the bytes being passed through to a given `Writer`; this is in analogy with the UNIX "tee" command

### readAll

public static String readAll(Reader in) throws IOException

Throws:
  `IOException`

### copy

public static void copy(Reader in, Writer out) throws IOException

Throws:
  `IOException`