<p>Sounds like a good idea. I'll give it a try and see how it works out.</p><p>Thanks,</p><p>--Gunnar</p><p><br></p>
<div class="gmail_quote">Am <a href="tel:02.08.2012%2014" value="+49208201214" target="_blank">02.08.2012 14</a>:23 schrieb "Sebastian Thomschke" <<a href="mailto:sebastian.thomschke@web.de" target="_blank">sebastian.thomschke@web.de</a>>:<br type="attribution">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+1 for wrapping the stream if necessary and extending the javadoc<br>
<br>
Regards,<br>
<br>
Seb<br>
<br>
On <a href="tel:02.08.2012%2014" value="+49208201214" target="_blank">02.08.2012 14</a>:22, Hardy Ferentschik wrote:<br>
> On 1 Jan 2012, at 8:56 AM, Gunnar Morling wrote:<br>
><br>
>> Hi all,<br>
>><br>
>> I'm currently implementing this change (new mandatory “version“ attribute in BV 1.1 XML descriptors) within the RI (see HV-595). The basic idea is to<br>
>><br>
>> * examine the root element for the version attribute using a parser (Stax in our case) and then<br>
>> * unmarshal the descriptor with JAXB, using the right XSD based on the retrieved version.<br>
>><br>
>> So I have to access the input streams representing the descriptors twice. This is no problem for the streams we're opening ourselves (validation.xml), but it could be an issue for streams passed via Configuration#addMapping().<br>
>><br>
>> I can see the following options now:<br>
>><br>
>> * read descriptor streams into a string first which then can be processed several times. Alternatively wrap any streams not supporting the mark/reset contract into a BufferedInputStream.<br>
>> * demand in the spec that any passed input stream must support mark/reset. This would also be beneficial for the scenario of creating several factories from one Configuration, which we discussed a while ago. But obviously this would be a non compatible change for 1.0 clients passing non resettable streams to addMapping().<br>
> What's about a combination of wrapping into BufferedInputStream and adding some javadocs. I think wrapping the input stream into a BufferedInputStream works fine. We can combine this<br>
> with a note in the javadocs that recommends to pass a input stream which supports mark/reset.<br>
><br>
> --Hardy<br>
><br>
><br>
> _______________________________________________<br>
> beanvalidation-dev mailing list<br>
> <a href="mailto:beanvalidation-dev@lists.jboss.org" target="_blank">beanvalidation-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
<br>
_______________________________________________<br>
beanvalidation-dev mailing list<br>
<a href="mailto:beanvalidation-dev@lists.jboss.org" target="_blank">beanvalidation-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
</blockquote></div>