is = GZIPHelper.toGZIPInputStream(contentEncoding, is);
return doExtractResponseBody(is, exchange);
}
private static InputStream doExtractResponseBody(InputStream is, Exchange exchange) throws IOException {
try {
<BUG>CachedOutputStream cos = new CachedOutputStream(exchange.getContext().getProperties());
IOHelper.copy(is, cos);</BUG>
return cos.getInputStream();
} finally {
ObjectHelper.close(is, "Extracting response body", LOG);

is = GZIPHelper.toGZIPInputStream(contentEncoding, is);
return doExtractResponseBody(is, exchange);
}
private static InputStream doExtractResponseBody(InputStream is, Exchange exchange) throws IOException {
try {
CachedOutputStream cos = new CachedOutputStream(exchange);
IOHelper.copy(is, cos);
return cos.getInputStream();
} finally {
ObjectHelper.close(is, "Extracting response body", LOG);
