Package com.ctc.wstx.io
Class MergedReader
- java.lang.Object
-
- java.io.Reader
-
- com.ctc.wstx.io.MergedReader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
public final class MergedReader extends Reader
SimpleReader
implementation that is used to "unwind" some data previously read from a Reader; so that as long as some of that data remains, it's returned; but as long as it's read, we'll just use data from the underlying original Reader. This is similar toPushbackReader
, but with this class there's only one implicit pushback, when instance is constructed; not general pushback buffer and methods to use it.
-
-
Constructor Summary
Constructors Constructor Description MergedReader(ReaderConfig cfg, Reader in, char[] buf, int start, int end)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
mark(int readlimit)
boolean
markSupported()
int
read()
int
read(char[] cbuf)
int
read(char[] cbuf, int off, int len)
boolean
ready()
void
reset()
long
skip(long n)
-
-
-
Constructor Detail
-
MergedReader
public MergedReader(ReaderConfig cfg, Reader in, char[] buf, int start, int end)
-
-
Method Detail
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classReader
- Throws:
IOException
-
mark
public void mark(int readlimit) throws IOException
- Overrides:
mark
in classReader
- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classReader
-
read
public int read() throws IOException
- Overrides:
read
in classReader
- Throws:
IOException
-
read
public int read(char[] cbuf) throws IOException
- Overrides:
read
in classReader
- Throws:
IOException
-
read
public int read(char[] cbuf, int off, int len) throws IOException
- Specified by:
read
in classReader
- Throws:
IOException
-
ready
public boolean ready() throws IOException
- Overrides:
ready
in classReader
- Throws:
IOException
-
reset
public void reset() throws IOException
- Overrides:
reset
in classReader
- Throws:
IOException
-
skip
public long skip(long n) throws IOException
- Overrides:
skip
in classReader
- Throws:
IOException
-
-