Class XMLDocumentOutputStream<T>

java.lang.Object
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 XMLDocumentInputStream.

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

Instances of this class are thread-safe.

See Also:
  • Constructor Details

    • XMLDocumentOutputStream

      public XMLDocumentOutputStream(OutputStream output)
      Constructor.
      Parameters:
      output - data destination
  • Method Details

    • 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.
      Parameters:
      obj - object to write
      Throws:
      IOException - if an I/O error occurs
      JiBXException - if JiBX encoding fails
    • close

      public void close() throws IOException
      Close the underlying output stream.
      Throws:
      IOException - if an I/O error occurs