JavaMoney / jsr354-ri

JSR 354 - Moneta: Reference Implementation
Other
344 stars 101 forks source link

introduce DataStreamFactory to fix InputStream reuse #238

Closed fprochazka closed 6 years ago

fprochazka commented 6 years ago

The problem

I've implemented my own consumer for eurofxref-hist.xml but there is no reason the have the file two times or have it downloaded two times, when it's the same resource. This library gives the impression that reusing resource for two exchange rate providers is completely fine so I went with it. Turns out, when two "listeners" both receive the same InputStream and they both try to read it, only the first one gets the data and for the second one the InputStream looks empty.

Solution

For every listener, there has to be a new fresh InputStream.


This change is Reviewable