class OspfMessageEncoder extends OneToOneEncoder {

    @Override
    protected Object encode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception {

        byte[] byteMsg = (byte[]) msg;
        log.debug("Encoding ospfMessage of length {}", byteMsg.length);
        ChannelBuffer channelBuffer = ChannelBuffers.buffer(byteMsg.length);
        channelBuffer.writeBytes(byteMsg);

        return channelBuffer;
    }

}