Package de.hybris.bootstrap.xml
Class UnicodeReader
java.lang.Object
java.io.Reader
de.hybris.bootstrap.xml.UnicodeReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
Generic unicode textreader, which will use BOM mark to identify the encoding to be used. If BOM is not found then use
a given default encoding. System default is used if: BOM mark is not found and defaultEnc is NULL
Usage pattern: String defaultEnc = "ISO-8859-1"; // or NULL to use system default FileInputStream fis = new FileInputStream(file); Reader in = new UnicodeReader(fis, defaultEnc);
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, read, ready, reset, skip, transferTo
-
Constructor Details
-
UnicodeReader
-
-
Method Details
-
getDefaultEncoding
-
getEncoding
-
init
Read-ahead four bytes and check for BOM marks. Extra bytes are unread back to the stream, only BOM bytes are skipped.- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException
-
read
- Specified by:
readin classReader- Throws:
IOException
-