public class StreamEventWriter extends BaseXMLEventWriter
XMLEventWriter that writes events to a character
stream using XMLEvent.writeAsEncodedUnicode(Writer).| Constructor and Description |
|---|
StreamEventWriter(File file)
Constructs a new
StreamEventWriter that writes to a file. |
StreamEventWriter(OutputStream os)
Constructs a new
StreamEventWriter that writes to a binary
stream. |
StreamEventWriter(Writer writer)
Constructs a new
StreamEventWriter that writes to a character
stream. |
| Modifier and Type | Method and Description |
|---|---|
void |
flush() |
protected void |
sendEvent(XMLEvent event)
Called by the methods of this class to write the event to the stream.
|
add, add, cacheAttribute, cacheNamespace, close, getNamespaceContext, getPrefix, peekNamespaceStack, popNamespaceStack, pushNamespaceStack, setDefaultNamespace, setNamespaceContext, setPrefixpublic StreamEventWriter(File file) throws IOException
StreamEventWriter that writes to a file.file - The file to write.IOException - If the file couldn't be opened.public StreamEventWriter(OutputStream os)
StreamEventWriter that writes to a binary
stream.os - The stream to write.public StreamEventWriter(Writer writer)
StreamEventWriter that writes to a character
stream.writer - The stream to write.public void flush()
throws XMLStreamException
flush in interface XMLEventWriterflush in class BaseXMLEventWriterXMLStreamExceptionprotected void sendEvent(XMLEvent event) throws XMLStreamException
BaseXMLEventWritersendEvent in class BaseXMLEventWriterevent - The event to write.XMLStreamException - If an error occurs processing the event.Copyright © 2019. All rights reserved.