public class ReaderFactory extends Object
Charset
,
Supported encodingsModifier and Type | Field and Description |
---|---|
static String |
FILE_ENCODING
The
file.encoding System Property. |
static String |
ISO_8859_1
Deprecated.
use
java.nio.charset.StandardCharset.ISO_8859_1 |
static String |
US_ASCII
Deprecated.
use
java.nio.charset.StandardCharset.US_ASCII |
static String |
UTF_16
Deprecated.
use
java.nio.charset.StandardCharset.UTF_16 |
static String |
UTF_16BE
Deprecated.
use
java.nio.charset.StandardCharset.UTF_16BE |
static String |
UTF_16LE
Deprecated.
use
java.nio.charset.StandardCharset.UTF_16LE |
static String |
UTF_8
Deprecated.
use
java.nio.charset.StandardCharset.UTF_8 |
Constructor and Description |
---|
ReaderFactory() |
Modifier and Type | Method and Description |
---|---|
static Reader |
newPlatformReader(File file)
Deprecated.
always specify an encoding. Do not depend on the default platform character set.
|
static Reader |
newReader(File file,
String encoding)
Create a new Reader with specified encoding.
|
static Reader |
newReader(InputStream in,
String encoding)
Create a new Reader with specified encoding.
|
static Reader |
newReader(URL url,
String encoding)
Create a new Reader with specified encoding.
|
static Reader |
newXmlReader(File file)
Deprecated.
use org.apache.commons.io.input.XmlStreamReader instead
|
static Reader |
newXmlReader(InputStream in)
Deprecated.
use org.apache.commons.io.input.XmlStreamReader instead
|
static Reader |
newXmlReader(URL url)
Deprecated.
use
org.apache.commons.io.input.XmlStreamReader instead |
@Deprecated public static final String ISO_8859_1
java.nio.charset.StandardCharset.ISO_8859_1
@Deprecated public static final String US_ASCII
java.nio.charset.StandardCharset.US_ASCII
@Deprecated public static final String UTF_16
java.nio.charset.StandardCharset.UTF_16
@Deprecated public static final String UTF_16BE
java.nio.charset.StandardCharset.UTF_16BE
@Deprecated public static final String UTF_16LE
java.nio.charset.StandardCharset.UTF_16LE
@Deprecated public static final String UTF_8
java.nio.charset.StandardCharset.UTF_8
public static final String FILE_ENCODING
file.encoding
System Property.@Deprecated public static Reader newXmlReader(@Nonnull InputStream in) throws IOException
in
- not null input streamIOException
- if any@Deprecated public static Reader newXmlReader(@Nonnull File file) throws IOException
file
- not null fileIOException
- if any@Deprecated public static Reader newXmlReader(@Nonnull URL url) throws IOException
org.apache.commons.io.input.XmlStreamReader
insteadurl
- not null URLIOException
- if any@Deprecated public static Reader newPlatformReader(@Nonnull File file) throws FileNotFoundException
file
- not null file.FileNotFoundException
- if anyCharset.defaultCharset()
public static Reader newReader(@Nonnull InputStream in, @Nonnull String encoding) throws UnsupportedEncodingException
in
- not null input streamencoding
- not null supported encodingUnsupportedEncodingException
- if anypublic static Reader newReader(@Nonnull File file, @Nonnull String encoding) throws FileNotFoundException, UnsupportedEncodingException
file
- not null fileencoding
- not null supported encodingFileNotFoundException
- if anyUnsupportedEncodingException
- if anypublic static Reader newReader(@Nonnull URL url, @Nonnull String encoding) throws IOException
url
- not null URLencoding
- not null supported encodingIOException
- if anyCopyright © 2002–2020 The Apache Software Foundation. All rights reserved.