private final InputStream stream;
private final StreamCache streamCache;
private final ReaderCache readCache;
public StreamSourceCache(StreamSource source, Exchange exchange) throws IOException {
if (source.getInputStream() != null) {
<BUG>CachedOutputStream cos = new CachedOutputStream(exchange.getContext().getProperties());
IOHelper.copyAndCloseInput(source.getInputStream(), cos);</BUG>
streamCache = cos.getStreamCache();
readCache = null;
setSystemId(source.getSystemId());

private final InputStream stream;
private final StreamCache streamCache;
private final ReaderCache readCache;
public StreamSourceCache(StreamSource source, Exchange exchange) throws IOException {
if (source.getInputStream() != null) {
CachedOutputStream cos = new CachedOutputStream(exchange);
IOHelper.copyAndCloseInput(source.getInputStream(), cos);
streamCache = cos.getStreamCache();
readCache = null;
setSystemId(source.getSystemId());
