|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.Writer
com.sun.xml.stream.writers.XMLWriter
public class XMLWriter
XMLWriter.
XMLWriter is not thread safe.
For efficiency this writer buffers the input. Use flush() function
to explicitly write the data to underlying stream.
This writer is designed in such a way that it atleast buffers the input to the
size specified. Unless flush is called, it guarantees that
data in chunks of size equal to or more than size specified will be written.
XMLWriter instance can be reused. setWriter() internally clears the
buffer and stores the reference to newly supplied Writer instance.
| Field Summary |
|---|
| Fields inherited from class java.io.Writer |
|---|
lock |
| Constructor Summary | |
|---|---|
XMLWriter(java.io.Writer writer)
Creates the instance of XMLWriter |
|
XMLWriter(java.io.Writer writer,
int size)
Creates the instnace of XMLWriter. |
|
| Method Summary | |
|---|---|
void |
close()
Close the stream, flushing it first. |
void |
flush()
Flush the stream. |
protected java.io.Writer |
getWriter()
Returns underlying Writer |
void |
reset()
Reset this Writer. |
void |
setWriter(java.io.Writer writer)
Set the given Writer. |
void |
setWriter(java.io.Writer writer,
int size)
Set the given Writer |
void |
write(char[] cbuf)
Write an array of characters. |
void |
write(char[] cbuf,
int off,
int len)
Write a portion of an array of characters. |
void |
write(int c)
Write a single character. |
void |
write(java.lang.String str)
Write a string. |
void |
write(java.lang.String str,
int off,
int len)
Write a portion of a string. |
| Methods inherited from class java.io.Writer |
|---|
append, append, append |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLWriter(java.io.Writer writer)
XMLWriter
public XMLWriter(java.io.Writer writer,
int size)
XMLWriter.
atleast buffers the input to the
size specified.
| Method Detail |
|---|
public void write(int c)
throws java.io.IOException
Subclasses that intend to support efficient single-character output should override this method.
write in class java.io.Writerc - int specifying a character to be written.
java.io.IOException - If an I/O error occurs
public void write(char[] cbuf)
throws java.io.IOException
write in class java.io.Writercbuf - Array of characters to be written
java.io.IOException - If an I/O error occurs
public void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
write in class java.io.Writercbuf - Array of charactersoff - Offset from which to start writing characterslen - Number of characters to write
java.io.IOException - If an I/O error occurs
public void write(java.lang.String str,
int off,
int len)
throws java.io.IOException
write in class java.io.Writerstr - A Stringoff - Offset from which to start writing characterslen - Number of characters to write
java.io.IOException - If an I/O error occurs
public void write(java.lang.String str)
throws java.io.IOException
write in class java.io.Writerstr - String to be written
java.io.IOException - If an I/O error occurs
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.Writerjava.io.IOException - If an I/O error occurs
public void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.Writerjava.io.IOException - If an I/O error occurspublic void reset()
public void setWriter(java.io.Writer writer)
Writer.
Writer - Writer.
public void setWriter(java.io.Writer writer,
int size)
Writer
Writer - Writer.int - Writer will buffer the character data size, after that data is written to stream.protected java.io.Writer getWriter()
Writer
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||