public final class MergedReader
extends java.io.Reader
Reader
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 to PushbackReader
, but with this class
there's only one implicit pushback, when instance is constructed; not
general pushback buffer and methods to use it.Modifier and Type | Field and Description |
---|---|
(package private) ReaderConfig |
mConfig |
(package private) char[] |
mData
This buffer contains the partially read remains left over after
bootstrapper has consumed xml declaration (if one found).
|
(package private) int |
mEnd |
(package private) java.io.Reader |
mIn |
(package private) int |
mPtr |
Constructor and Description |
---|
MergedReader(ReaderConfig cfg,
java.io.Reader in,
char[] buf,
int start,
int end) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
private void |
freeMergedBuffer() |
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) |
final ReaderConfig mConfig
final java.io.Reader mIn
char[] mData
int mPtr
final int mEnd
public MergedReader(ReaderConfig cfg, java.io.Reader in, char[] buf, int start, int end)
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 void mark(int readlimit) throws java.io.IOException
mark
in class java.io.Reader
java.io.IOException
public boolean markSupported()
markSupported
in class java.io.Reader
public int read() throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public int read(char[] cbuf) throws java.io.IOException
read
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
public boolean ready() throws java.io.IOException
ready
in class java.io.Reader
java.io.IOException
public void reset() throws java.io.IOException
reset
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
private void freeMergedBuffer()