Package de.elo.utils.io
Class UnicodeReader
java.lang.Object
java.io.Reader
de.elo.utils.io.UnicodeReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
Überschrift: UnicodeReader.
Beschreibung: 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);
Copyright: Copyright (c) ELO Digital Office GmbH 2018 - 2022
-
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
Konstruktor.- Parameters:
is- InputStreamdefaultEncoding- Default-Kodierung
-
-
Method Details
-
getDefaultEncoding
Liefert die Default-Kodierung zurück.- Returns:
- Default-Kodierung
-
getEncoding
Liefert die Kodierung zurück.- Returns:
- Kodierung
-
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
-