I have a use-case where I get an object of a different nature, which I cannot change. I need to serialize this object to the wire as a ProtoBuf object. I have a mirror ProtoBuf object structure, all defined and working fine. However, I currently need to deep-clone my original object into the PB object and then call writeTo() on it, and this deep-cloning is too expensive for my perf goals. Any ideas how I could get around this cloning? I was thinking about customizing the ProtoC code generation to generate the objects as extending my hierarchy (but I don't like the idea of rewriting ProtoC), or to use an external writeTo() that takes my original object (rather than the gen'ed ProtoBuf one), but none of them seem feasible all the way thru...
BTW, I'm using all Java.
Thanks in advance!