{@link XMLStreamReader} wrapper that encodes XOP. It assumes that the underlying readerimplements the extension defined by {@link DataHandlerReader} so that it can identify theinformation items to optimize (by looking for {@link javax.xml.stream.XMLStreamConstants#CHARACTERS} events for which{@link DataHandlerReader#isBinary()} returns
true
). The {@link DataHandler}objects for the parts referenced by
xop:Include element information items produced by an instance of this class can be retrieved using the {@link #getDataHandler(String)} method.
Note that the primary purpose of this class is not to serialize an XML infoset to an XOP package (this is better done using {@link XOPEncodingStreamWriter}), but rather to optimize interaction (by exchanging {@link DataHandler} objects instead of base64 encoded representations) withdatabinding frameworks that understand XOP, but that are not aware of the {@link DataHandlerReader} extension.
This class defers loading of {@link DataHandler} objects until {@link #getDataHandler(String)} iscalled, except if this is not supported by the underlying stream.