protobuf
protobuf copied to clipboard
Ruby: Convert Protocol::MyType to byte[]
Hi, How can I convert the protobuf object of custom type to byte array? I have this autogenerated module called protocol
module ProtoCol
MyType = Google::Protobuf::DescriptorPool.generated_pool.lookup("protocol.MyType").msgclass
end
how can I get byte array of Protocol::MyType object?
I don't understand your question. What do you mean by converting to byte[]. Encode?
@TeBoring Closing it. I had to do object.to_proto.to_s.