Package javanet.staxutils.io
Class StreamEventWriter
java.lang.Object
javanet.staxutils.BaseXMLEventWriter
javanet.staxutils.io.StreamEventWriter
- All Implemented Interfaces:
XMLEventConsumer,XMLEventWriter
XMLEventWriter that writes events to a character stream
using XMLEvent.writeAsEncodedUnicode(Writer).- Version:
- $Revision: 1.4 $
- Author:
- Christian Niles
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionStreamEventWriter(File file) Constructs a newStreamEventWriterthat writes to a file.Constructs a newStreamEventWriterthat writes to a binary stream.StreamEventWriter(Writer writer) Constructs a newStreamEventWriterthat writes to a character stream. -
Method Summary
Methods inherited from class javanet.staxutils.BaseXMLEventWriter
add, add, cacheAttribute, cacheNamespace, close, getNamespaceContext, getPrefix, peekNamespaceStack, popNamespaceStack, pushNamespaceStack, setDefaultNamespace, setNamespaceContext, setPrefix
-
Constructor Details
-
StreamEventWriter
Constructs a newStreamEventWriterthat writes to a file.- Parameters:
file- The file to write.- Throws:
IOException- If the file couldn't be opened.
-
StreamEventWriter
Constructs a newStreamEventWriterthat writes to a binary stream.- Parameters:
os- The stream to write.
-
StreamEventWriter
Constructs a newStreamEventWriterthat writes to a character stream.- Parameters:
writer- The stream to write.
-
-
Method Details
-
flush
- Specified by:
flushin interfaceXMLEventWriter- Overrides:
flushin classBaseXMLEventWriter- Throws:
XMLStreamException
-
sendEvent
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.
-