Ejemplo n.º 1
0
 @Override
 public ChannelBuffer encode(LevelColorMessage message) throws IOException {
   ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
   ChannelBufferUtils.writeString(buffer, message.getType());
   buffer.writeInt(message.getValue());
   return buffer;
 }
Ejemplo n.º 2
0
 @Override
 public LevelColorMessage decode(ChannelBuffer buffer) throws IOException {
   String type = ChannelBufferUtils.readString(buffer);
   int value = buffer.readInt();
   return new LevelColorMessage(type, value);
 }