use of com.ning.compress.lzf.parallel.PLZFOutputStream in project camel by apache.
the class LZFDataFormat method marshal.
@Override
public void marshal(final Exchange exchange, final Object graph, final OutputStream stream) throws Exception {
InputStream is = exchange.getContext().getTypeConverter().mandatoryConvertTo(InputStream.class, exchange, graph);
OutputStream compressedOutput = parallelCompression ? new PLZFOutputStream(stream) : new LZFOutputStream(stream);
try {
IOHelper.copy(is, compressedOutput);
} finally {
// must close all input streams
IOHelper.close(is, compressedOutput);
}
}
Aggregations