Package org.openstreetmap.josm.io
Class UTFInputStreamReader
- java.lang.Object
-
- java.io.Reader
-
- java.io.InputStreamReader
-
- org.openstreetmap.josm.io.UTFInputStreamReader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Readable
public final class UTFInputStreamReader extends java.io.InputStreamReader
Detects the different UTF encodings from byte order mark.- Since:
- 3372
-
-
Constructor Summary
Constructors Modifier Constructor Description privateUTFInputStreamReader(java.io.InputStream in, java.lang.String cs)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static UTFInputStreamReadercreate(java.io.InputStream input)Creates a newInputStreamReaderfrom theInputStreamwith UTF-8 as default encoding.static UTFInputStreamReadercreate(java.io.InputStream input, java.lang.String defaultEncoding)Creates a newInputStreamReaderfrom theInputStream.
-
-
-
Constructor Detail
-
UTFInputStreamReader
private UTFInputStreamReader(java.io.InputStream in, java.lang.String cs) throws java.io.UnsupportedEncodingException
- Throws:
java.io.UnsupportedEncodingException
-
-
Method Detail
-
create
public static UTFInputStreamReader create(java.io.InputStream input) throws java.io.IOException
Creates a newInputStreamReaderfrom theInputStreamwith UTF-8 as default encoding.- Parameters:
input- input stream- Returns:
- A reader with the correct encoding. Starts to read after the BOM.
- Throws:
java.io.IOException- if any I/O error occurs- See Also:
create(java.io.InputStream, String)
-
create
public static UTFInputStreamReader create(java.io.InputStream input, java.lang.String defaultEncoding) throws java.io.IOException
Creates a newInputStreamReaderfrom theInputStream.- Parameters:
input- input streamdefaultEncoding- Used, when no BOM was recognized. Can be null.- Returns:
- A reader with the correct encoding. Starts to read after the BOM.
- Throws:
java.io.IOException- if any I/O error occurs
-
-