Hi all,<div><br></div><div>I have an application built on Netty that receives large XML messages over HTTP POST. These are chunked. Right now, I'm simply using the chunk aggregator, getting a String from the ContentBuffer (using HTTP Content-Type for encoding info) and wrapping that in a StringReader, wrapping that in an InputSource and passing it to the SAXParser. Obviously, this isn't ideal. </div>
<div><br></div><div>I'd like to drive the SAX parser with the chunks as they're received. I theorize that I would need some sort of OutputStream that generates SAX events (calls methods of my handler) as I write(). I can't find such a thing. Does it exist? Is it a flawed idea? Is there any way to have Netty expose the chunk stream as an InputStream?</div>
<div><br></div><div>The next best thing I've found is the PipedInputStream, but that would require additional threadding that I'd like to avoid. </div><div><br></div><div>Any thoughts? Obviously SAX is meant to deal with this kind of problem - it's simply an issue of how Netty/the pipline presents the received chunks to the parser. This has to be a common problem for someone to want to solve. </div>
<div><br></div><div>Cheers,</div><div>Mathew Johnston</div>