Package org.omegat.util.xml
Class XMLReader
java.lang.Object
java.io.Reader
org.omegat.util.xml.XMLReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
Deprecated, for removal: This API element is subject to removal in a future version.
This class automatically detects encoding of an inner XML file and constructs
a Reader with appropriate encoding.
Detecting of encoding is done by reading a value from XML header
<?xml version="1.0" encoding="..."?>
If encoding isn't specified, or it is not supported by Java platform, the file is opened in default system encoding (ISO-8859-2 in USA, Windows-1251 on my OS).
-
Constructor Summary
ConstructorsConstructorDescriptionXMLReader(InputStream inputStream, String encoding) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Creates a new instance of XMLReader.Deprecated, for removal: This API element is subject to removal in a future version.Creates a new instance of XMLReader. -
Method Summary
Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, read, ready, reset, skip, transferTo
-
Constructor Details
-
XMLReader
Deprecated, for removal: This API element is subject to removal in a future version.Creates a new instance of XMLReader. If encoding cannot be detected, falls back to default encoding of Operating System.- Parameters:
fileName- - the file to read- Throws:
IOException
-
XMLReader
Deprecated, for removal: This API element is subject to removal in a future version.Creates a new instance of XMLReader. If encoding cannot be detected, falls back to suppliedencoding, or (if supplied null, or supplied encoding is not supported by JVM) falls back to default encoding of Operating System.- Parameters:
fileName- The file to read.encoding- The encoding to use if we can't autodetect.- Throws:
IOException
-
XMLReader
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
IOException
-
-
Method Details
-
close
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException
-
read
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
readin classReader- Throws:
IOException
-