camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fxthomas <felix.tho...@gmail.com>
Subject Re: kyro data format in camel
Date Mon, 14 Sep 2015 07:26:16 GMT
here is the class implementataion also.

public final class KyroDataFormat implements DataFormat {

	@Override
	public void marshal(Exchange exchange, Object graph, OutputStream stream)
			throws Exception {
		stream.write(new KryoSerializationUtil().serialize(graph));

	}

	@Override
	public Object unmarshal(Exchange exchange, InputStream stream)
			throws Exception {
		final byte[] bytes = exchange.getContext().getTypeConverter()
				.mandatoryConvertTo(byte[].class, stream);
		return new KryoSerializationUtil().deserialize(bytes, XXXX.class);
	}

}



--
View this message in context: http://camel.465427.n5.nabble.com/kyro-data-format-in-camel-tp5771093p5771489.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message