Serializing TObjects to a uint8_t array

For future searchers, the answer to this was found in an ancient 16-year-old post by Fons (link below). Basically, you have to build your own Message class that inherits from TMessage. At that point, you can serialize any TObject-inheriting class into a raw uint8_t array, send it along any channel you like, then reconstruct it on the other end.

Note added: you probably will want to add SetBit(TBuffer::kIsOwner, false) to your constructor to avoid double free issues with the buffer you provide to TMessage.