class ContentReader
extends java.io.Reader
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
charsReadTooMuch
The characters that have been read too much.
|
private int |
charsToGo
The number of characters in the delimiter that stil need to be scanned.
|
private char[] |
delimiter
The delimiter that will indicate the end of the stream.
|
private IXMLEntityResolver |
entityResolver
The encapsulated entityResolver.
|
private char |
escapeChar
The escape char (& or %).
|
private boolean |
pastInitialPrefix
True if we are passed the initial prefix.
|
private IXMLReader |
reader
The encapsulated reader.
|
private boolean |
useLowLevelReader
True if the escape char (& or %) needs to be left untouched.
|
Constructor and Description |
---|
ContentReader(IXMLReader reader,
IXMLEntityResolver entityResolver,
char escapeChar,
char[] delimiter,
boolean useLowLevelReader,
java.lang.String prefix)
Creates the reader.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Skips remaining data and closes the stream.
|
protected void |
finalize()
Cleans up the object when it's destroyed.
|
int |
read(char[] buffer,
int offset,
int size)
Reads a block of data.
|
private IXMLReader reader
private IXMLEntityResolver entityResolver
private char escapeChar
private char[] delimiter
private java.lang.String charsReadTooMuch
private int charsToGo
private boolean useLowLevelReader
private boolean pastInitialPrefix
ContentReader(IXMLReader reader, IXMLEntityResolver entityResolver, char escapeChar, char[] delimiter, boolean useLowLevelReader, java.lang.String prefix)
reader
- the encapsulated readerentityResolver
- resolves entitiesescapeChar
- escape character (& or %)delimiter
- the delimiter, as a backwards string, that will indicate the end of the
streamuseLowLevelReader
- true if & needs to be left untouched; false if entities need to
be processedprefix
- chars that are already readprotected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public int read(char[] buffer, int offset, int size) throws java.io.IOException
read
in class java.io.Reader
buffer
- where to put the read dataoffset
- first position in buffer to put the datasize
- maximum number of chars to readjava.io.IOException
- if an error occurred reading the datapublic 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
- if an error occurred reading the data