|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Writer org.apache.commons.io.output.XmlStreamWriter
public class XmlStreamWriter
Character stream that handles all the necessary Voodo to figure out the charset encoding of the XML document written to the stream.
XmlStreamReader
Field Summary |
---|
Fields inherited from class java.io.Writer |
---|
lock |
Constructor Summary | |
---|---|
XmlStreamWriter(File file)
Construct an new XML stream writer for the specified file with a default encoding of UTF-8. |
|
XmlStreamWriter(File file,
String defaultEncoding)
Construct an new XML stream writer for the specified file with the specified default encoding. |
|
XmlStreamWriter(OutputStream out)
Construct an new XML stream writer for the specified output stream with a default encoding of UTF-8. |
|
XmlStreamWriter(OutputStream out,
String defaultEncoding)
Construct an new XML stream writer for the specified output stream with the specified default encoding. |
Method Summary | |
---|---|
void |
close()
Close the underlying writer. |
void |
flush()
Flush the underlying writer. |
String |
getDefaultEncoding()
Return the default encoding. |
String |
getEncoding()
Return the detected encoding. |
void |
write(char[] cbuf,
int off,
int len)
Write the characters to the underlying writer, detecing encoding. |
Methods inherited from class java.io.Writer |
---|
append, append, append, write, write, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlStreamWriter(OutputStream out)
out
- The output streampublic XmlStreamWriter(OutputStream out, String defaultEncoding)
out
- The output streamdefaultEncoding
- The default encoding if not encoding could be detectedpublic XmlStreamWriter(File file) throws FileNotFoundException
file
- The file to write to
FileNotFoundException
- if there is an error creating or
opening the filepublic XmlStreamWriter(File file, String defaultEncoding) throws FileNotFoundException
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 fileMethod Detail |
---|
public String getEncoding()
public String getDefaultEncoding()
public void close() throws IOException
close
in interface Closeable
close
in class Writer
IOException
- if an error occurs closing the underlying writerpublic void flush() throws IOException
flush
in interface Flushable
flush
in class Writer
IOException
- if an error occurs flushing the underlying writerpublic void write(char[] cbuf, int off, int len) throws IOException
write
in class 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |