org.apache.camel.impl
Class ZipDataFormat
java.lang.Object
org.apache.camel.impl.ZipDataFormat
- All Implemented Interfaces:
- DataFormat
public class ZipDataFormat
- extends Object
- implements DataFormat
"Deflate" compression data format.
See ZipFileDataFormat
for Zip file compression.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ZipDataFormat
public ZipDataFormat()
ZipDataFormat
public ZipDataFormat(int compressionLevel)
getCompressionLevel
public int getCompressionLevel()
setCompressionLevel
public void setCompressionLevel(int compressionLevel)
marshal
public void marshal(Exchange exchange,
Object graph,
OutputStream stream)
throws Exception
- Description copied from interface:
DataFormat
- Marshals the object to the given Stream.
- Specified by:
marshal
in interface DataFormat
- Parameters:
exchange
- the current exchangegraph
- the object to be marshalledstream
- the output stream to write the marshalled result to
- Throws:
Exception
- can be thrown
unmarshal
public Object unmarshal(Exchange exchange,
InputStream stream)
throws Exception
- Description copied from interface:
DataFormat
- Unmarshals the given stream into an object.
Notice: The result is set as body on the exchange OUT message.
It is possible to mutate the OUT message provided in the given exchange parameter.
For instance adding headers to the OUT message will be preserved.
It's also legal to return the same passed exchange as is but also a
Message
object as well which will be used as the OUT message of exchange.
- Specified by:
unmarshal
in interface DataFormat
- Parameters:
exchange
- the current exchangestream
- the input stream with the object to be unmarshalled
- Returns:
- the unmarshalled object
- Throws:
Exception
- can be thrown
Apache Camel