@SuppressWarnings ("unchecked")
public <T extends Message> Message getWrappedMessage(T dynamicMessage) throws IOException {
MessageCodec<T> codec = (MessageCodec<T>) getCodecLookupService().find(dynamicMessage.getClass());
ByteBuf buffer = codec.encode(Spout.getPlatform() == Platform.CLIENT, dynamicMessage);
return new ServerPluginMessage(getName(codec), buffer.array());
}