public class MultiReader
extends java.io.Reader
FilterReader
, but when the first delegate is at end-of-input, it continues
with reading from the next delegate.
This Reader
does not support MARK.
Modifier and Type | Field and Description |
---|---|
private java.io.Reader |
currentDelegate |
private java.util.Iterator<java.io.Reader> |
delegateIterator |
private java.util.List<java.io.Reader> |
delegates |
private static java.io.Reader |
EMPTY_READER |
Constructor and Description |
---|
MultiReader(java.util.List<java.io.Reader> delegates) |
MultiReader(java.io.Reader[] delegates) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes all delegates.
|
int |
read() |
int |
read(char[] cbuf,
int off,
int len) |
long |
skip(long n) |
private static final java.io.Reader EMPTY_READER
private final java.util.List<java.io.Reader> delegates
private final java.util.Iterator<java.io.Reader> delegateIterator
private java.io.Reader currentDelegate
public MultiReader(java.util.List<java.io.Reader> delegates)
public MultiReader(java.io.Reader[] delegates)
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.Reader
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.Reader
java.io.IOException
public int read(char[] cbuf, int off, int len) throws java.io.IOException
read
in class java.io.Reader
java.io.IOException