Package de.pdark.decentxml
Class XMLInputStreamReader
- java.lang.Object
-
- java.io.Reader
-
- de.pdark.decentxml.XMLInputStreamReader
-
-
Field Summary
Fields Modifier and Type Field Description static String
ENCODING_ISO_8859_1
The constant "ISO-8859-1", also called "Latin-1"static String
ENCODING_ISO_Latin_1
An alias for ENCODING_ISO_8859_1static Map<String,String>
ENCODING_MAP
A map to convert standard XML encodings into Java encodings.static String
ENCODING_UTF_8
The constant "UTF-8"static Map<String,String>
JAVA_TO_XML_ENCODING_MAP
A map to convert standard Java encodings into XML encodings.static Pattern
VERSION_PATTERN
-
Constructor Summary
Constructors Constructor Description XMLInputStreamReader(InputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
determineEncoding()
Determine the encoding of the stream.String
getJavaEncoding()
Get the Java name of the XML encoding of the stream.String
getXmlEncoding()
Return the encoding of the streamint
read(char[] cbuf, int off, int len)
void
setXmlEncoding(String xmlEncoding)
If you know the encoding, you can override it here.
-
-
-
Field Detail
-
ENCODING_UTF_8
public static final String ENCODING_UTF_8
The constant "UTF-8"- See Also:
- Constant Field Values
-
ENCODING_ISO_8859_1
public static final String ENCODING_ISO_8859_1
The constant "ISO-8859-1", also called "Latin-1"- See Also:
- Constant Field Values
-
ENCODING_ISO_Latin_1
public static final String ENCODING_ISO_Latin_1
An alias for ENCODING_ISO_8859_1- See Also:
- Constant Field Values
-
ENCODING_MAP
public static Map<String,String> ENCODING_MAP
A map to convert standard XML encodings into Java encodings.The map is mutable; you can put your own encodings in here if you need them.
-
JAVA_TO_XML_ENCODING_MAP
public static Map<String,String> JAVA_TO_XML_ENCODING_MAP
A map to convert standard Java encodings into XML encodings.The map is mutable; you can put your own encodings in here if you need them.
-
VERSION_PATTERN
public static final Pattern VERSION_PATTERN
-
-
Constructor Detail
-
XMLInputStreamReader
public XMLInputStreamReader(InputStream in)
-
-
Method Detail
-
determineEncoding
public void determineEncoding()
Determine the encoding of the stream.It is safe to call this method more than once from a single thread.
-
getXmlEncoding
public String getXmlEncoding()
Return the encoding of the stream
-
setXmlEncoding
public void setXmlEncoding(String xmlEncoding)
If you know the encoding, you can override it here.When you do that, the reader will ignore the encoding in the stream if there is one.
-
getJavaEncoding
public String getJavaEncoding()
Get the Java name of the XML encoding of the stream.
-
close
public void close() throws IOException
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classReader
- Throws:
IOException
-
read
public int read(char[] cbuf, int off, int len) throws IOException
- Specified by:
read
in classReader
- Throws:
IOException
-
-