use of org.apache.mina.filter.codec.ProtocolEncoderOutput in project camel by apache.
the class Mina2UdpProtocolCodecFactory method getEncoder.
public ProtocolEncoder getEncoder(IoSession session) throws Exception {
return new ProtocolEncoder() {
public void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws Exception {
IoBuffer buf = toIoBuffer(message);
buf.flip();
out.write(buf);
}
public void dispose(IoSession session) throws Exception {
// do nothing
}
};
}
use of org.apache.mina.filter.codec.ProtocolEncoderOutput in project camel by apache.
the class MinaUdpProtocolCodecFactory method getEncoder.
public ProtocolEncoder getEncoder() throws Exception {
return new ProtocolEncoder() {
public void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws Exception {
ByteBuffer buf = toByteBuffer(message);
buf.flip();
out.write(buf);
}
public void dispose(IoSession session) throws Exception {
// do nothing
}
};
}
Aggregations