use of org.apache.camel.converter.stream.OutputStreamBuilder in project camel by apache.
the class ZipDataFormat method unmarshal.
public Object unmarshal(final Exchange exchange, final InputStream inputStream) throws Exception {
InflaterInputStream inflaterInputStream = new InflaterInputStream(inputStream);
OutputStreamBuilder osb = OutputStreamBuilder.withExchange(exchange);
try {
IOHelper.copy(inflaterInputStream, osb);
return osb.build();
} finally {
// must close input streams
IOHelper.close(osb, inflaterInputStream, inputStream);
}
}
Aggregations