protected void encode(ChannelHandlerContext ctx, Object msg, List<Object> out) throws Exception {
if (msg instanceof IPacket) {
IPacket packet = (IPacket) msg;
if (log.isDebugEnabled())
log.debug("Sending packet: {} to channel: {}", msg, ctx.channel());
<BUG>String encodedPacket = encodePacket(packet);
</BUG>
if (log.isDebugEnabled())
log.debug("Encoded packet: {}", encodedPacket);
TransportType transportType = packet.getTransportType();

protected void encode(ChannelHandlerContext ctx, Object msg, List<Object> out) throws Exception {
if (msg instanceof IPacket) {
IPacket packet = (IPacket) msg;
if (log.isDebugEnabled())
log.debug("Sending packet: {} to channel: {}", msg, ctx.channel());
ByteBuf encodedPacket = encodePacket(packet);
if (log.isDebugEnabled())
log.debug("Encoded packet: {}", encodedPacket);
TransportType transportType = packet.getTransportType();
