Package javanet.staxutils.io
Class StreamEventWriter
- java.lang.Object
-
- javanet.staxutils.BaseXMLEventWriter
-
- javanet.staxutils.io.StreamEventWriter
-
- All Implemented Interfaces:
XMLEventConsumer,XMLEventWriter
public class StreamEventWriter extends BaseXMLEventWriter
XMLEventWriterthat writes events to a character stream usingXMLEvent.writeAsEncodedUnicode(Writer).- Version:
- $Revision: 1.4 $
- Author:
- Christian Niles
-
-
Constructor Summary
Constructors Constructor Description StreamEventWriter(File file)Constructs a newStreamEventWriterthat writes to a file.StreamEventWriter(OutputStream os)Constructs a newStreamEventWriterthat writes to a binary stream.StreamEventWriter(Writer writer)Constructs a newStreamEventWriterthat writes to a character stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflush()protected voidsendEvent(XMLEvent event)Called by the methods of this class to write the event to the stream.-
Methods inherited from class javanet.staxutils.BaseXMLEventWriter
add, add, cacheAttribute, cacheNamespace, close, getNamespaceContext, getPrefix, peekNamespaceStack, popNamespaceStack, pushNamespaceStack, setDefaultNamespace, setNamespaceContext, setPrefix
-
-
-
-
Constructor Detail
-
StreamEventWriter
public StreamEventWriter(File file) throws IOException
Constructs a newStreamEventWriterthat writes to a file.- Parameters:
file- The file to write.- Throws:
IOException- If the file couldn't be opened.
-
StreamEventWriter
public StreamEventWriter(OutputStream os)
Constructs a newStreamEventWriterthat writes to a binary stream.- Parameters:
os- The stream to write.
-
StreamEventWriter
public StreamEventWriter(Writer writer)
Constructs a newStreamEventWriterthat writes to a character stream.- Parameters:
writer- The stream to write.
-
-
Method Detail
-
flush
public void flush() throws XMLStreamException- Specified by:
flushin interfaceXMLEventWriter- Overrides:
flushin classBaseXMLEventWriter- Throws:
XMLStreamException
-
sendEvent
protected void sendEvent(XMLEvent event) throws XMLStreamException
Description copied from class:BaseXMLEventWriterCalled by the methods of this class to write the event to the stream.- Specified by:
sendEventin classBaseXMLEventWriter- Parameters:
event- The event to write.- Throws:
XMLStreamException- If an error occurs processing the event.
-
-