return null;
}
}
private static HttpEntity asHttpEntity(InputStream in, Exchange exchange) throws IOException {
InputStreamEntity entity;
if (!exchange.getProperty(Exchange.SKIP_GZIP_ENCODING, Boolean.FALSE, Boolean.class)) {
String contentEncoding = exchange.getIn().getHeader(Exchange.CONTENT_ENCODING, String.class);
InputStream stream = GZIPHelper.compressGzip(contentEncoding, in);
entity = new InputStreamEntity(stream, stream instanceof ByteArrayInputStream
? stream.available() != 0 ? stream.available() : -1 : -1);
} else {
entity = new InputStreamEntity(in, -1);
}
if (exchange != null) {
String contentEncoding = exchange.getIn().getHeader(Exchange.CONTENT_ENCODING, String.class);
String contentType = ExchangeHelper.getContentType(exchange);
entity.setContentEncoding(contentEncoding);
entity.setContentType(contentType);
}
return entity;
}