On Thursday 03 February 2011 5:08:10 pm Sergey Beryozkin wrote: > Hi > > I'm looking at the XMLStreamDataReader in the SourceDataBinding and trying > to figure out what I can 'borrow' :-) from that code > to have the JAX-RS SourceProvider optimized. > > The XMLStreamDataReader calls a resetForStreaming(XMLStreamReader) > function, when StaxSource or SAXSource is expected which seems like the > key piece of the optimization.
Yep. > What exactly does it do and would it make sense to consider reusing that > code in the non-SOAP case, where we don't have wrapping tags like > soap:env and soap:body to deal with ? We need to make sure that the later calls to find the close tags for soap:body and soap:env don't occur. We pretty much just try to make sure nothing else touches the input stream or xml reader. The FragmentStreamReader then kind of filters out those closing tags as well. > It seems the best I can do in the plain XML case is to create the > XMLStreamReader from the InputStream... Yep. That's the best option. Nice and simple. :-) -- Daniel Kulp dk...@apache.org http://dankulp.com/blog