public class WriterFactory extends Object
Charset, 
Supported encodings| Modifier 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 | 
|---|
WriterFactory()  | 
| Modifier and Type | Method and Description | 
|---|---|
static Writer | 
newPlatformWriter(File file)
Deprecated. 
 
always specify an encoding. Do not depend on the default platform character set. 
 | 
static Writer | 
newPlatformWriter(OutputStream out)
Deprecated. 
 
always specify an encoding. Do not depend on the default platform character set. 
 | 
static Writer | 
newWriter(File file,
         String encoding)
Create a new Writer with specified encoding. 
 | 
static Writer | 
newWriter(OutputStream out,
         String encoding)
Create a new Writer with specified encoding. 
 | 
static XmlStreamWriter | 
newXmlWriter(File file)
Create a new Writer with XML encoding detection rules. 
 | 
static XmlStreamWriter | 
newXmlWriter(OutputStream out)
Create a new Writer with XML encoding detection rules. 
 | 
@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_8public static final String FILE_ENCODING
file.encoding System Property.public static XmlStreamWriter newXmlWriter(@Nonnull OutputStream out) throws IOException
out - not null output streamIOException - if anyXmlStreamWriterpublic static XmlStreamWriter newXmlWriter(@Nonnull File file) throws IOException
file - not null fileIOException - if anyXmlStreamWriter@Deprecated public static Writer newPlatformWriter(@Nonnull OutputStream out)
out - not null output stream@Deprecated public static Writer newPlatformWriter(@Nonnull File file) throws IOException
file - not null fileIOException - if anypublic static Writer newWriter(@Nonnull OutputStream out, @Nonnull String encoding) throws UnsupportedEncodingException
out - not null output streamencoding - not null supported encodingUnsupportedEncodingException - if anypublic static Writer newWriter(@Nonnull File file, @Nonnull String encoding) throws UnsupportedEncodingException, FileNotFoundException
file - not null fileencoding - not null supported encodingUnsupportedEncodingException - if anyFileNotFoundException - if anyCopyright © 2002–2021 The Apache Software Foundation. All rights reserved.