Reader that evaluates the XML header. It selects its encoding based on the encoding read with the XML
header of the provided InputStream. The default encoding is UTF-8 and the version is 1.0 if the
stream does not contain an XML header or the attributes are not set within the header.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final String | |
| private final InputStreamReader | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private final double | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements abstract java. Implements java. |
| public boolean | equals(final Object
the reference object with which to compare. obj)Overrides java. |
| public String | |
| private Map | |
| public double | |
| public int | |
| public void | mark(final int
Limit on the number of characters that may be
read while still preserving the mark. After
reading this many characters, attempting to
reset the stream may fail. readAheadLimit)Overrides java. |
| public boolean | markSupported()
Overrides java. |
| public int | |
| public int | read(final char[]
Destination buffer cbuf, final int Offset at which to start storing characters offset, final int Maximum number of characters to read length)Implements abstract java. |
| public int | read(final char[]
Destination buffer cbuf)Overrides java. |
| public boolean | |
| public void | |
| public long | |
| public String |
| KEY_ENCODING | back to summary |
|---|---|
| private static final String KEY_ENCODING | |
| KEY_VERSION | back to summary |
|---|---|
| private static final String KEY_VERSION | |
| reader | back to summary |
|---|---|
| private final InputStreamReader reader | |
| STATE_ATTR_NAME | back to summary |
|---|---|
| private static final int STATE_ATTR_NAME | |
| STATE_ATTR_VALUE | back to summary |
|---|---|
| private static final int STATE_ATTR_VALUE | |
| STATE_AWAIT_XML_HEADER | back to summary |
|---|---|
| private static final int STATE_AWAIT_XML_HEADER | |
| STATE_BOM | back to summary |
|---|---|
| private static final int STATE_BOM | |
| STATE_START | back to summary |
|---|---|
| private static final int STATE_START | |
| version | back to summary |
|---|---|
| private final double version | |
| XML_TOKEN | back to summary |
|---|---|
| private static final String XML_TOKEN | |
| XmlHeaderAwareReader | back to summary |
|---|---|
| public XmlHeaderAwareReader(final InputStream in) throws UnsupportedEncodingException, IOException Constructs an XmlHeaderAwareReader.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements abstract java. Implements java. Doc from java. Closes the stream and releases any system resources associated with it. Once the stream has been closed, further read(), ready(), mark(), reset(), or skip() invocations will throw an IOException. Closing a previously closed stream has no effect.
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| getEncoding | back to summary |
|---|---|
public String getEncoding()
| |
| getHeader | back to summary |
|---|---|
| private Map | |
| getVersion | back to summary |
|---|---|
public double getVersion()
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| mark | back to summary |
|---|---|
| public void mark(final int readAheadLimit) throws IOException Overrides java. Doc from java. Marks the present position in the stream. Subsequent calls to reset() will attempt to reposition the stream to this point. Not all character-input streams support the mark() operation.
| |
| markSupported | back to summary |
|---|---|
| public boolean markSupported() Overrides java. Doc from java. Tells whether this stream supports the mark() operation. The default implementation always returns false. Subclasses should override this method.
| |
| read | back to summary |
|---|---|
| public int read() throws IOException Overrides java. Doc from java. Reads a single character. This method will block until a character is available, an I/O error occurs, or the end of the stream is reached. Subclasses that intend to support efficient single-character input should override this method.
| |
| read | back to summary |
|---|---|
| public int read(final char[] cbuf, final int offset, final int length) throws IOException Implements abstract java. Doc from java. Reads characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached. If
| |
| read | back to summary |
|---|---|
| public int read(final char[] cbuf) throws IOException Overrides java. Doc from java. Reads characters into an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached. If the length of
| |
| ready | back to summary |
|---|---|
| public boolean ready() throws IOException Overrides java. Doc from java. Tells whether this stream is ready to be read.
| |
| reset | back to summary |
|---|---|
| public void reset() throws IOException Overrides java. Doc from java. Resets the stream. If the stream has been marked, then attempt to reposition it at the mark. If the stream has not been marked, then attempt to reset it in some way appropriate to the particular stream, for example by repositioning it to its starting point. Not all character-input streams support the reset() operation, and some support reset() without supporting mark().
| |
| skip | back to summary |
|---|---|
| public long skip(final long n) throws IOException Overrides java. Doc from java. Skips characters. This method will block until some characters are available, an I/O error occurs, or the end of the stream is reached. If the stream is already at its end before this method is invoked, then no characters are skipped and zero is returned.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
| |