Re: [protobuf] Parse/Decode raw protobuf msg

2017-04-23 Thread Rohan Suri
Thanks a lot Feng :) On Thursday, April 20, 2017 at 6:38:12 AM UTC+5:30, Feng Xiao wrote: > > > > On Wed, Apr 19, 2017 at 1:26 PM, Rohan Suri > wrote: > >> You create a descriptor by using --descriptor_set_out right? >> > That's right. You can make that part of your build process and embed the >

Re: [protobuf] Parse/Decode raw protobuf msg

2017-04-19 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Apr 19, 2017 at 1:26 PM, Rohan Suri wrote: > You create a descriptor by using --descriptor_set_out right? > That's right. You can make that part of your build process and embed the generated data file into your binary however you want. > Followed by creating FileDescriptorProto by using

Re: [protobuf] Parse/Decode raw protobuf msg

2017-04-19 Thread Rohan Suri
You create a descriptor by using --descriptor_set_out right? Followed by creating FileDescriptorProto by using parseFrom(FileInputStream)? And moving forward as stated here https://groups.google.com/d/msg/protobuf/bWlJaaMmx4Q/kIYJ1-5YRb0J On Wednesday, April 19, 2017 at 11:43:42 PM UTC+5:30, F

Re: [protobuf] Parse/Decode raw protobuf msg

2017-04-19 Thread 'Feng Xiao' via Protocol Buffers
CodedInputStream is the right one to use for 1. Invoking protoc compiler in production sounds problematic to me, though I'm not aware of any document listing it explicitly as bad practice. I would suggest avoid that and use other alternatives. For example, in Google we build a protodb which contai

Re: [protobuf] Parse/Decode raw protobuf msg

2017-04-19 Thread Rohan Suri
Hey Feng, thanks for your input. Any suggestions for 1) ? Other than using CodingInputStream? Also is it bad practise to invoke protoc compiler in a production environment? On Wednesday, April 19, 2017 at 11:00:17 PM UTC+5:30, Feng Xiao wrote: > > > > On Wed, Apr 19, 2017 at 4:20 AM, Rohan Suri

Re: [protobuf] Parse/Decode raw protobuf msg

2017-04-19 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Apr 19, 2017 at 4:20 AM, Rohan Suri wrote: > Hello everyone, > > I'm trying to find the right Java APIs to do what protoc --decode_raw and > protoc --decode do. > Essentially handling two cases: > 1) When I don't have the proto, and only the raw protobuf msg. > eg protoc --decode_raw < ra