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

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

public class XMLDocumentInputStream<T>
extends Object

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

XML documents are converted into Java objects via JiBXUtil.readObject().

Instances of this class are thread-safe.

See Also:
XMLDocumentOutputStream

Constructor Summary
XMLDocumentInputStream(Class<T> type, InputStream input)
          Constructor.
 
Method Summary
 void close()
           
 T read()
          Read the next XML document, parsed and objectified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLDocumentInputStream

public XMLDocumentInputStream(Class<T> type,
                              InputStream input)
Constructor.

Parameters:
type - Java type for XML documents
input - data source
Method Detail

read

public T read()
       throws IOException,
              JiBXException
Read the next XML document, parsed and objectified.

Returns:
decoded object or null on EOF
Throws:
IOException
JiBXException

close

public void close()
           throws IOException
Throws:
IOException