public void encode(IoSession session, Object message, ProtocolEncoderOutput out)
throws Exception {
Packet packet = (Packet) message;
byte[] response = packet.commandBytes();
IoBuffer buffer = IoBuffer.allocate(response.length+1, false);
buffer.put(response);
buffer.put((byte)0);
buffer.flip();