camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zemin Hu <>
Subject Re: return binary image data in camel/restlet environment
Date Wed, 09 Oct 2013 15:14:27 GMT
Thanks for quick fix, Willem. I will check it out. Actually your suggestion
to set body to inputstream works very well, here is part of the code in case
anybody wants to do the same:
	        exchange.getOut().setHeader( Exchange.HTTP_RESPONSE_CODE, 200 );
	        exchange.getOut().setHeader( Exchange.CONTENT_TYPE, mediaType );
        	ByteArrayInputStream bais = new ByteArrayInputStream(imageData);
	        exchange.getOut().setBody( bais );

Finally, I tried to use ByteArrayOutputStream at first place, it did not
work, I am still wondering why it's inputsteam not outputstream since I am
send data out from Camel point of view.

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message