? XmlStreamWriter
java.lang.Object
java.io.Writer
org.apache.commons.io.output.XmlStreamWriter
- ????????:
Closeable
,Flushable
,Appendable
,AutoCloseable
Character stream that handles all the necessary Voodoo to figure out the
charset encoding of the XML document written to the stream.
- ???????:
- 2.0
- ????:
-
????
-
?????
????????XmlStreamWriter
(File file) Constructs a new XML stream writer for the specified file with a default encoding of UTF-8.XmlStreamWriter
(File file, String defaultEncoding) Constructs a new XML stream writer for the specified file with the specified default encoding.Constructs a new XML stream writer for the specified output stream with a default encoding of UTF-8.XmlStreamWriter
(OutputStream out, String defaultEncoding) Constructs a new XML stream writer for the specified output stream with the specified default encoding. -
????
-
???????
-
XmlStreamWriter
Constructs a new XML stream writer for the specified output stream with a default encoding of UTF-8.- ??:
out
- The output stream
-
XmlStreamWriter
Constructs a new XML stream writer for the specified output stream with the specified default encoding.- ??:
out
- The output streamdefaultEncoding
- The default encoding if not encoding could be detected
-
XmlStreamWriter
Constructs a new XML stream writer for the specified file with a default encoding of UTF-8.- ??:
file
- The file to write to- ??:
FileNotFoundException
- if there is an error creating or opening the file
-
XmlStreamWriter
Constructs a new XML stream writer for the specified file with the specified default encoding.- ??:
file
- The file to write todefaultEncoding
- The default encoding if not encoding could be detected- ??:
FileNotFoundException
- if there is an error creating or opening the file
-
-
??????
-
getEncoding
Returns the detected encoding.- ??:
- the detected encoding
-
getDefaultEncoding
Returns the default encoding.- ??:
- the default encoding
-
close
Closes the underlying writer.- ???:
close
????AutoCloseable
- ???:
close
????Closeable
- ???:
close
???Writer
- ??:
IOException
- if an error occurs closing the underlying writer
-
flush
Flushes the underlying writer.- ???:
flush
????Flushable
- ???:
flush
???Writer
- ??:
IOException
- if an error occurs flushing the underlying writer
-
write
Writes the characters to the underlying writer, detecting encoding.- ???:
write
???Writer
- ??:
cbuf
- the buffer to write the characters fromoff
- The start offsetlen
- The number of characters to write- ??:
IOException
- if an error occurs detecting the encoding
-