public class XmlStreamWriter
extends java.io.Writer
To build an instance, see XmlStreamWriter.Builder.
XmlStreamReader| Modifier and Type | Class and Description |
|---|---|
static class |
XmlStreamWriter.Builder
Builds a new
XmlStreamWriter instance. |
| Constructor and Description |
|---|
XmlStreamWriter(java.io.File file)
Deprecated.
|
XmlStreamWriter(java.io.File file,
java.lang.String defaultEncoding)
Deprecated.
|
XmlStreamWriter(java.io.OutputStream out)
Deprecated.
|
XmlStreamWriter(java.io.OutputStream out,
java.lang.String defaultEncoding)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static XmlStreamWriter.Builder |
builder()
Constructs a new
XmlStreamWriter.Builder. |
void |
close()
Closes the underlying writer.
|
void |
flush()
Flushes the underlying writer.
|
java.lang.String |
getDefaultEncoding()
Returns the default encoding.
|
java.lang.String |
getEncoding()
Returns the detected encoding.
|
void |
write(char[] cbuf,
int off,
int len)
Writes the characters to the underlying writer, detecting encoding.
|
@Deprecated
public XmlStreamWriter(java.io.File file)
throws java.io.FileNotFoundException
builder(), XmlStreamWriter.Builder, and XmlStreamWriter.Builder.get()file - The file to write tojava.io.FileNotFoundException - if there is an error creating or
opening the file@Deprecated
public XmlStreamWriter(java.io.File file,
java.lang.String defaultEncoding)
throws java.io.FileNotFoundException
builder(), XmlStreamWriter.Builder, and XmlStreamWriter.Builder.get()file - The file to write todefaultEncoding - The default encoding if not encoding could be detectedjava.io.FileNotFoundException - if there is an error creating or
opening the file@Deprecated public XmlStreamWriter(java.io.OutputStream out)
builder(), XmlStreamWriter.Builder, and XmlStreamWriter.Builder.get()out - The output stream@Deprecated
public XmlStreamWriter(java.io.OutputStream out,
java.lang.String defaultEncoding)
builder(), XmlStreamWriter.Builder, and XmlStreamWriter.Builder.get()out - The output streamdefaultEncoding - The default encoding if not encoding could be detectedpublic static XmlStreamWriter.Builder builder()
XmlStreamWriter.Builder.XmlStreamWriter.Builder.public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.Writerjava.io.IOException - if an error occurs closing the underlying writerpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.Writerjava.io.IOException - if an error occurs flushing the underlying writerpublic java.lang.String getDefaultEncoding()
public java.lang.String getEncoding()
public void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
write in class java.io.Writercbuf - the buffer to write the characters fromoff - The start offsetlen - The number of characters to writejava.io.IOException - if an error occurs detecting the encodingCopyright © 2010 - 2023 Adobe. All Rights Reserved