Hi Claus, I don't know why did you remove the checking codes of 'is' (the instance of InputStream). Do I miss something ?
Thanks, Willem [email protected] wrote: > Author: davsclaus > Date: Fri May 22 18:52:13 2009 > New Revision: 777655 > > URL: http://svn.apache.org/viewvc?rev=777655&view=rev > Log: > polished code > > Modified: > > camel/trunk/camel-core/src/main/java/org/apache/camel/impl/GzipDataFormat.java > > Modified: > camel/trunk/camel-core/src/main/java/org/apache/camel/impl/GzipDataFormat.java > URL: > http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/GzipDataFormat.java?rev=777655&r1=777654&r2=777655&view=diff > ============================================================================== > --- > camel/trunk/camel-core/src/main/java/org/apache/camel/impl/GzipDataFormat.java > (original) > +++ > camel/trunk/camel-core/src/main/java/org/apache/camel/impl/GzipDataFormat.java > Fri May 22 18:52:13 2009 > @@ -29,12 +29,8 @@ > > public class GzipDataFormat implements DataFormat { > > - public void marshal(Exchange exchange, Object graph, OutputStream stream) > - throws Exception { > - InputStream is = > exchange.getContext().getTypeConverter().convertTo(InputStream.class, graph); > - if (is == null) { > - throw new IllegalArgumentException("Cannot get the inputstream > for GzipDataFormat mashalling"); > - } > + public void marshal(Exchange exchange, Object graph, OutputStream > stream) throws Exception { > + InputStream is = > exchange.getContext().getTypeConverter().mandatoryConvertTo(InputStream.class, > graph); > > GZIPOutputStream zipOutput = new GZIPOutputStream(stream); > try { > @@ -45,8 +41,7 @@ > > } > > - public Object unmarshal(Exchange exchange, InputStream stream) > - throws Exception { > + public Object unmarshal(Exchange exchange, InputStream stream) throws > Exception { > InputStream is = ExchangeHelper.getMandatoryInBody(exchange, > InputStream.class); > GZIPInputStream unzipInput = new GZIPInputStream(is); > > > >
