org.dellroad.stuff.jibx
Class XMLDocumentOutputStream<T>

java.lang.Object
  extended by org.dellroad.stuff.jibx.XMLDocumentOutputStream<T>
Type Parameters:
T - XML document type

public class XMLDocumentOutputStream<T>
extends Object

OutputStream over which XML documents are passed. This class is a companion to XMLDocumentOutputStream.

XML documents are created from Java objects via JiBXUtil.writeObject().

Instances of this class are thread-safe.

See Also:
XMLDocumentInputStream

Constructor Summary
XMLDocumentOutputStream(Class<T> type, OutputStream output)
          Constructor.
 
Method Summary
 void close()
          Close the underlying output stream.
 void write(T obj)
          Write the object encoded as XML to the underlying output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLDocumentOutputStream

public XMLDocumentOutputStream(Class<T> type,
                               OutputStream output)
Constructor.

Parameters:
type - Java type for XML documents
output - data destination
Method Detail

write

public void write(T obj)
           throws IOException,
                  JiBXException
Write the object encoded as XML to the underlying output stream. The underlying output stream is flushed.

Throws:
IOException
JiBXException

close

public void close()
           throws IOException
Close the underlying output stream.

Throws:
IOException