Package edu.jas.util
Class CatReader
- java.lang.Object
-
- java.io.Reader
-
- edu.jas.util.CatReader
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Readable
public class CatReader extends java.io.Reader
Reader to conncat two readers. Read from first reader until it is empty, then read from second reader.- Author:
- Heinz Kredel
-
-
Constructor Summary
Constructors Constructor Description CatReader(java.io.Reader f, java.io.Reader s)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close this Reader.int
read(char[] cbuf, int off, int len)
Read char array.
-
-
-
Constructor Detail
-
CatReader
public CatReader(java.io.Reader f, java.io.Reader s)
Constructor.- Parameters:
f
- first Reader.s
- second Reader.
-
-
Method Detail
-
read
public int read(char[] cbuf, int off, int len) throws java.io.IOException
Read char array.- Specified by:
read
in classjava.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 interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in classjava.io.Reader
- Throws:
java.io.IOException
-
-