[protobuf] Building GeneratedMessageV3 from JSON string using Dynamic message in Java

2019-01-30 Thread Яни Начев
Hi, I' ve got a problem to create dynamic message from JSON. I want to use that message to send it through the MannagedChannel using the command 'newCall()' Here is my progress: File file = new File("/path/to/api_descriptor.pb"); byte[] payload = ByteStreams.toByteArray(new

Re: [protobuf] Language mappings for Protobuf Types

2019-01-30 Thread Michael Powell
I found the same for proto2, thanks! On Wed, Jan 30, 2019 at 8:12 PM Michael Powell wrote: > > On Wed, Jan 30, 2019 at 8:05 PM Mohammed Nisamudheen S > wrote: > > > > Following table can be the one you are looking for. > > > > https://developers.google.com/protocol-buffers/docs/proto3#scalar >

Re: [protobuf] Language mappings for Protobuf Types

2019-01-30 Thread Michael Powell
On Wed, Jan 30, 2019 at 8:05 PM Mohammed Nisamudheen S wrote: > > Following table can be the one you are looking for. > > https://developers.google.com/protocol-buffers/docs/proto3#scalar Sorry, I should be more specific: proto2. But this is a start, thank you. > On Thu, Jan 31, 2019 at 3:35 AM

Re: [protobuf] Language mappings for Protobuf Types

2019-01-30 Thread Mohammed Nisamudheen S
Following table can be the one you are looking for. https://developers.google.com/protocol-buffers/docs/proto3#scalar On Thu, Jan 31, 2019 at 3:35 AM Michael Powell wrote: > Hello, > > I am looking for a table or some cross reference for target language > to Protocol Buffer types and key

[protobuf] Re: how to populate a repeated bytes field?

2019-01-30 Thread joe . parness
That did the trick, thanks. On Wednesday, January 30, 2019 at 2:35:58 PM UTC-8, joe.p...@decisionsciencescorp.com wrote: > > I have a protobuf that contains a repeated field of repeated bytes as > described below. It is my understanding that TransferData::data is > essentially a list of

Re: [protobuf] Re: how to populate a repeated bytes field?

2019-01-30 Thread 'Adam Cozzette' via Protocol Buffers
OK, I see the problem. data is a member function, so you have to call data(). And actually data() returns a const reference while mutable_data() returns a pointer for mutable access, so in your case where you are modifying the field, you have to call mutable_data(). On Wed, Jan 30, 2019 at 3:28

[protobuf] Re: how to populate a repeated bytes field?

2019-01-30 Thread joe . parness
TransferData transferData; transferData.data.Reserve(3); On Wednesday, January 30, 2019 at 2:35:58 PM UTC-8, joe.p...@decisionsciencescorp.com wrote: > > I have a protobuf that contains a repeated field of repeated bytes as > described below. It is my understanding that

Re: [protobuf] Re: how to populate a repeated bytes field?

2019-01-30 Thread 'Adam Cozzette' via Protocol Buffers
That's strange, could you post the snippet of code that the compiler is complaining about? On Wed, Jan 30, 2019 at 3:22 PM wrote: > I think the real problem is that the compiler complains "TransferData::data' > does not have class type" error when trying to call any of data's (repeated > bytes)

[protobuf] Re: how to populate a repeated bytes field?

2019-01-30 Thread joe . parness
I think the real problem is that the compiler complains "TransferData::data' does not have class type" error when trying to call any of data's (repeated bytes) methods. On Wednesday, January 30, 2019 at 2:35:58 PM UTC-8, joe.p...@decisionsciencescorp.com wrote: > > I have a protobuf that

Re: [protobuf] how to populate a repeated bytes field?

2019-01-30 Thread 'Adam Cozzette' via Protocol Buffers
You can call mutable_data(), which will return a pointer to a google::protobuf::RepeatedPtrField, which is similar to a vector of std::string pointers. Here is what the API looks like:

[protobuf] how to populate a repeated bytes field?

2019-01-30 Thread joe . parness
I have a protobuf that contains a repeated field of repeated bytes as described below. It is my understanding that TransferData::data is essentially a list of vectors(arrays), correct? If so how does one go about setting the size of data and then populating each array? message TransferData {

[protobuf] Language mappings for Protobuf Types

2019-01-30 Thread Michael Powell
Hello, I am looking for a table or some cross reference for target language to Protocol Buffer types and key types. I can make some informed guesses, of course, but if there was a generally recognized table, cross reference, something like that, that would be a useful reference. Thanks! Best