Justin Johnson wrote:
3. Insert length of XML packet information at the beginning for the
XML data.
You could always include your length info into the payload, and make
implementors promise to put it in the first 1KB (for example) of the
stream. Something like this:
<metaFile len="12345" xmlns="urn:microsoft.com:graphics:wmf">
<setAbort len="1">shpl0itz!</setAbort>
</metaFile>
Please remember that you can't fully trust this kind of number that
comes in over the wire, and it makes no difference whether it's in- or
out-of-band. Luckily we have ArrayIndexOutOfBoundsException... :)
-0xe1a