edu.jas.util
Class CatReader
java.lang.Object
java.io.Reader
edu.jas.util.CatReader
- All Implemented Interfaces:
- java.io.Closeable, java.lang.Readable
public class CatReader
- extends java.io.Reader
Reader to concat two readers.
Read from first reader until it is empty, then read from second reader.
- Author:
- Heinz Kredel
Fields inherited from class java.io.Reader |
lock |
Constructor Summary |
CatReader(java.io.Reader f,
java.io.Reader s)
Constructor. |
Method Summary |
void |
close()
Close this Reader. |
int |
read(char[] cbuf,
int off,
int len)
Read char array. |
Methods inherited from class java.io.Reader |
mark, markSupported, read, read, read, ready, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CatReader
public CatReader(java.io.Reader f,
java.io.Reader s)
- Constructor.
- Parameters:
f
- first Reader.s
- second Reader.
read
public int read(char[] cbuf,
int off,
int len)
throws java.io.IOException
- Read char array.
- Specified by:
read
in class java.io.Reader
- Parameters:
cbuf
- array.off
- start offset.len
- number of chars to read.
- Returns:
- number of chars read, or -1.
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Close this Reader.
- Specified by:
close
in interface java.io.Closeable
- Specified by:
close
in class java.io.Reader
- Throws:
java.io.IOException