java.lang.Object | ||
↳ | java.io.Reader | |
↳ | com.atlassian.jira.util.XmlReader |
This handles several XML-related tasks that normal java.io Readers don't support, inluding use of IETF standard encoding names and automatic detection of most XML encodings. The former is needed for interoperability; the latter is needed to conform with the XML spec. This class also optimizes reading some common encodings by providing low-overhead unsynchronized Reader support.
Note that the autodetection facility should be used only on data streams which have an unknown character encoding. For example, it should never be used on MIME text/xml entities.
Note that XML processors are only required to support UTF-8 and UTF-16 character encodings. Autodetection permits the underlying Java implementation to provide support for many other encodings, such as US-ASCII, ISO-8859-5, Shift_JIS, EUC-JP, and ISO-2022-JP.
[Expand]
Inherited Fields | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.io.Reader
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Closes the reader.
| |||||||||||
Constructs the reader from an input stream, autodetecting
the encoding to use according to the heuristic specified
in the XML 1.0 recommendation.
| |||||||||||
Creates a reader supporting the given encoding, mapping
from standard encoding names to ones that understood by
Java where necessary.
| |||||||||||
Returns the standard name of the encoding in use
| |||||||||||
Sets a mark allowing a limited number of characters to
be "peeked", by reading and then resetting.
| |||||||||||
Returns true iff the reader supports mark/reset.
| |||||||||||
Reads a single character.
| |||||||||||
Reads the number of characters read into the buffer, or -1 on EOF.
| |||||||||||
Returns true iff input characters are known to be ready.
| |||||||||||
Resets the current position to the last marked position.
| |||||||||||
Skips a specified number of characters.
|
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.io.Reader
| |||||||||||||||||||||||||||||||
From class java.lang.Object | |||||||||||||||||||||||||||||||
From interface
java.io.Closeable
| |||||||||||||||||||||||||||||||
From interface
java.lang.AutoCloseable
| |||||||||||||||||||||||||||||||
From interface
java.lang.Readable
|
Constructs the reader from an input stream, autodetecting the encoding to use according to the heuristic specified in the XML 1.0 recommendation.
in | the input stream from which the reader is constructed |
---|
IOException | on error, such as unrecognized encoding |
---|
Creates a reader supporting the given encoding, mapping from standard encoding names to ones that understood by Java where necessary.
in | the input stream from which the reader is constructed |
---|---|
encoding | the IETF standard name of the encoding to use; if null, autodetection is used. |
IOException | on error, including unrecognized encoding |
---|
Sets a mark allowing a limited number of characters to be "peeked", by reading and then resetting.
value | how many characters may be "peeked". |
---|
IOException |
---|
Returns true iff the reader supports mark/reset.
Reads the number of characters read into the buffer, or -1 on EOF.
IOException |
---|