|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Reader net.n3.nanoxml.ContentReader
class ContentReader
This reader reads data from another reader until a certain string is encountered.
Field Summary | |
---|---|
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. |
Fields inherited from class java.io.Reader |
---|
lock |
Constructor Summary | |
---|---|
ContentReader(IXMLReader reader,
IXMLEntityResolver entityResolver,
char escapeChar,
char[] delimiter,
boolean useLowLevelReader,
java.lang.String prefix)
Creates the reader. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.io.Reader |
---|
mark, markSupported, read, read, read, ready, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
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 readMethod Detail |
---|
protected 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 read
java.io.IOException
- if an error occurred reading the datapublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.Reader
java.io.IOException
- if an error occurred reading the data
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |